Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int a, b, ergebnis, divisor, dividend, i;
  9. cout <<"Erste Zahl: " <<endl;
  10. cin >> a;
  11. cout <<"Zweite Zahl: " <<endl;
  12. cin >>b;
  13.  
  14. while
  15. if (a<b){
  16. divisor = a;
  17. dividend = b;
  18.  
  19. }
  20. else {
  21. divisor = b;
  22. dividend = a;
  23. }
  24.  
  25.  
  26. for ( ; ((b%divisor !=0)||(a%divisor!=0));divisor--){
  27.  
  28. }
  29.  
  30. cout << "Der gemeinsame Teiler lautet: " <<divisor<<endl;
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement