Advertisement
Guest User

BAC 2014 august SIII prb. 3

a guest
Feb 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. ///BAC 2014 august SIII prb. 3
  2. #include <iostream>
  3. #include <fstream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n,x,y,z;
  9.     cin>>n;
  10.     for(x=0;x<=n-2;x++){
  11.         for(y=x+1;y<=n-1;y++){
  12.             for(z=y+1;z<=n;z++){
  13.                 if(x*y + y*z == n){
  14.                     cout<<"("<<x<<","<<y<<","<<z<<")"<<endl;
  15.                 }
  16.             }
  17.         }
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement