Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int a, b, ergebnis, divisor, dividend, i;
- cout <<"Erste Zahl: " <<endl;
- cin >> a;
- cout <<"Zweite Zahl: " <<endl;
- cin >>b;
- while
- if (a<b){
- divisor = a;
- dividend = b;
- }
- else {
- divisor = b;
- dividend = a;
- }
- for ( ; ((b%divisor !=0)||(a%divisor!=0));divisor--){
- }
- cout << "Der gemeinsame Teiler lautet: " <<divisor<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement