Advertisement
Gireada

Tema nr.6 Info

Nov 5th, 2012
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. #include <iostream.h>
  2. #include <conio.h>
  3.  
  4. int main()
  5. {int a,b;
  6. cin>>a>>b;
  7.     while(a!=b)
  8.     {
  9.         if(a>b)
  10.         {
  11.             a=a-b;
  12.         }
  13.         else
  14.         {
  15.             b=b-a;
  16.         }
  17.     }
  18. cout<<b;
  19. getch();
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement