Posted By

cuspajzodgraha on 04/14/15


Tagged


Versions (?)

Greyfoxov peti


 / Published in: C++
 

amburator

  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<cmath>
  4. using namespace std;
  5.  
  6. int main(){
  7. int N;
  8. do{
  9. cout<<"Znas kaj: ";
  10. cin>>N;
  11. }while(N<0);
  12. int n= N*2; // jer formula za površinu takvog trokuta je P= (a*b)/2, pa se 2 prebaci na drugu stranu...
  13. for(int i=1; i<=n; i++)
  14. for(int j=n; j>0; j--)
  15. if(i*j==n) cout<<i<<" "<<j<<endl;
  16. system("PAUSE");
  17. return 0;
  18. }

Report this snippet  

You need to login to post a comment.