|
|
|
@ -1189,7 +1189,7 @@ int main(void) {
|
|
|
|
|
printf("Operator: ");
|
|
|
|
|
scanf(" %c", &op);
|
|
|
|
|
|
|
|
|
|
printf("Result: %i", berechne(x, y, op));
|
|
|
|
|
printf("Result: %i\n", berechne(x, y, op));
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
@ -1266,29 +1266,15 @@ int main(int argc, char *argv[]) {
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
long int ggt_while(long int x, long int y) {
|
|
|
|
|
if (x == y) {
|
|
|
|
|
return x;
|
|
|
|
|
} else if (x > y) {
|
|
|
|
|
x -= y;
|
|
|
|
|
while (x != y) {
|
|
|
|
|
if (x > y) {
|
|
|
|
|
x -= y;
|
|
|
|
|
} else {
|
|
|
|
|
y -= x;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return x;
|
|
|
|
|
} else {
|
|
|
|
|
y -= x;
|
|
|
|
|
while (x != y) {
|
|
|
|
|
if (x > y) {
|
|
|
|
|
x -= y;
|
|
|
|
|
} else {
|
|
|
|
|
y -= x;
|
|
|
|
|
}
|
|
|
|
|
while (x != y) {
|
|
|
|
|
if (x > y) {
|
|
|
|
|
x -= y;
|
|
|
|
|
} else {
|
|
|
|
|
y -= x;
|
|
|
|
|
}
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
long int ggt_rec(long int x, long int y) {
|
|
|
|
|