Renewed Structure

This commit is contained in:
e2hang
2025-08-28 21:17:28 +08:00
parent b97f348a51
commit 1a5c4329b2
163 changed files with 312 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#include <iostream>
#include <cmath>
using namespace std;
int gcd(int x, int y){
x = abs(x);
y = abs(y);
if(y == 0)
return x;
if(y > 0)
return gcd(y, x % y);
return 0;
}
int main(){
cout << gcd(20 ,30) << endl;
cout << gcd(112, 42) << endl;
cout << gcd(-112,42) << endl;
return 0;
}