Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4. #include <iomanip>
  5. using namespace std;
  6.  
  7.  
  8. int main(int argc, const char * argv[]) {
  9.     int a, b,h,v,n, N;
  10.     cin>>v;
  11.     n=1;
  12.     a=1;
  13.     h=1;
  14.     N=1;
  15.     b=v/a;
  16.     for (n = 1; n < v; n++)
  17.     {
  18.         for (N = 1; N < v; N++) {
  19.             if (a*n<=b/n && h*N<=b/N)
  20.             {
  21.                 if (b%n==0 && b%(N*n)==0)
  22.                 {
  23.                     cout<<a*n<<"x"<<h*N<<"x"<<b/(n*N) << endl;
  24.                 }
  25.             }
  26.         }
  27.     }
  28.    
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement