26 lines
485 B
C++
26 lines
485 B
C++
#include <iostream>
|
|
#include <windows.h>
|
|
#include <iomanip>
|
|
|
|
using namespace std;
|
|
|
|
int ggT(int a, int b) {
|
|
while (b != 0) {
|
|
int temp = b;
|
|
b = a % b;
|
|
a = temp;
|
|
}
|
|
return a;
|
|
}
|
|
|
|
int main() {
|
|
SetConsoleOutputCP(CP_UTF8);
|
|
cout << fixed << setprecision(2);
|
|
|
|
int a,b;
|
|
cout << "Gib die zwei Zahlen ein von denen du den gemeinsamen teiler wissen möchtest: \n";
|
|
cin >> a >> b;
|
|
|
|
cout << endl << "Ergebnis: " << ggT(a,b);
|
|
return 0;
|
|
} |