feat: Initial commit

This commit is contained in:
2024-03-22 17:14:57 +01:00
parent dc83234df1
commit db9bafe755
45 changed files with 1996 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#include <stdio.h>
int mcd(int a, int b) {
if (a == 0) {
return b;
}
if (a > b) {
return mcd(a % b, b);
} else {
return mcd(b % a, a);
}
}
int main()
{
int a, b, res;
if (scanf("%d %d", &a, &b) != 2) {
puts("Error, invalid input!");
return 1;
}
if (a < 0 || b < 0) {
puts("Error, you must insert two positive integers!");
return 1;
}
res = mcd(a, b);
printf("MCD = %d\n", res);
return 0;
}