This commit is contained in:
2025-04-21 00:40:30 +02:00
parent 9ccc21edde
commit b8c75fc6d3
87 changed files with 2788 additions and 99 deletions

9
S1/GdCP/a02.c Normal file
View File

@@ -0,0 +1,9 @@
int sequence(int x, int n){
if (n < 0) return 0;
for (int i = 0; i < n; i++) {
if (x % 2 == 0) x = x/2;
else x = 3 * x + 1;
if (x < 0) return -1;
}
return x;
};