inital commit, adding all school projects
This commit is contained in:
26
gemeinsamerTeiler/main.cpp
Normal file
26
gemeinsamerTeiler/main.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user