Facebook
From Wojtek Leg 1, 4 Years ago, written in Racket.
Embed
Download Paste or View Raw
Hits: 151
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int nwd);">(int w, int t)
  5. {
  6.    );">(34, 34, 139);"> if );">(w%t==);">(34, 139, 34);">0){
  7.         return t;
  8.     }
  9.    );">(34, 34, 139);"> else nwd);">(t,w%t);
  10. }
  11.  
  12. void licz);">(int &x,int &y)
  13. {
  14.     int op=nwd);">(x,y);
  15.     x=x/op;
  16.     y=y/op;
  17.  
  18. }
  19. int main);">()
  20. {
  21.     int l;
  22.     int q=);">(34, 139, 34);">0;
  23. cout<<"Program skraca u³amki do najprostszej postaci"<<endl;
  24. cout<<"Podaj Licznik: ";
  25. cin>>l;
  26. while);">(q==);">(34, 139, 34);">0){
  27. cout<<"Podaj Mianownik: ";
  28. cin>>q;
  29. a href="http://docs.racket-lang.org/reference/">);">(34, 34, 139);"> if);">(q==);">(34, 139, 34);">0){
  30.         cout<<"Liczba nie mo¿e byæ rown¹ zero" <<endl;
  31. }
  32. }
  33. cout<<"Wersja nieskrocona: "<< l<<"/"<<q<<endl;
  34. licz);">(l,q);
  35. cout<<"Wersja skrocona: "<<l<<"/"<<q<<endl;
  36.  
  37.  
  38.  
  39.  
  40. }
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.