Facebook
From Chunky Hummingbird, 3 Years ago, written in C++.
This paste is a reply to Re: dasd from Crimson Cat - view diff
Embed
Download Paste or View Raw
Hits: 74
  1. //algorytm Euklidesa
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.         int a, b;
  7.   cout<<"wpisz wartosc a: ";
  8. cin>>a;
  9. cout<<"wpisz wartosc b: ";
  10. cin>>b;
  11.         while(a!=b)
  12.  
  13.  
  14.  
  15. {
  16.         if(a>b)
  17.         a=a-b;
  18.         else
  19.         b=b-a;
  20. }
  21. cout << a;
  22. }
  23.