Guest User

wypok

a guest
Apr 12th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. int nwd(int a, int b)
  2. {
  3.     int r;
  4.     do
  5.     {
  6.     r=a%b;
  7.     a=b;
  8.     b=r;
  9.     }
  10.     while(b>0);
  11.    
  12.     return a;
  13. }
  14.  
  15. lub
  16.  
  17. int nwd2(int a, int b)
  18. {
  19.     while(a!=b)
  20.     { if(a>b) { a=a-b; }
  21.       if(b>a) { b=b-a; }
  22.     }
  23.    
  24.     return a;
  25. }
  26.  
  27. i na nww:
  28.  
  29. int nww(int a, int b, int c)
  30. {  
  31.     return a*b/c;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment