STANAANDREY

P3 ian

Jan 28th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. unsigned long p,a,b,c;
  8.  
  9. cout<<"p=";cin>>p;
  10.  
  11.   for (a=1;a<p-2;a++)
  12.   for (b=1;b<p-2;b++)
  13. {
  14.     c=p-a-b;
  15.     if (a+b>c&&c+b>a&&a+c>b)
  16.     cout<<a<<" "<<b<<" "<<c<<endl;
  17. }
  18.  
  19.  return 0;
  20. }
Add Comment
Please, Sign In to add comment