Advertisement
icatalin

Problema 10 tema suplimentara

Nov 27th, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a,b,ca,cb,r;
  8.     for (a=1,b=3;a<=100,b<=100;a=a+2,b=b+2)
  9.     {
  10.         ca=a;
  11.         cb=b;
  12.         while(ca)
  13.         { r=cb%ca;
  14.           cb=ca;
  15.           ca=r;
  16.         }
  17.  
  18.         if (cb==1){
  19.             cout<<a<<endl;
  20.             cout<<b<<endl;
  21.             cout<<"pauza"<<endl;
  22.         }
  23.  
  24.  
  25.  
  26. }
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement