I'll give you a flag if you can get a negative number by adding only positive numbers.
nc rivit.dev 10009
1 month ago
int main(){ setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stdin, NULL, _IONBF, 0);
int acc = 0; int n; while (acc >= 0){ printf("acc = %d\n", acc); printf("Enter a number: "); if (scanf("%d", &n) != 1){ puts("Error reading integer"); } else { if (n < 0){ puts("You can't enter the negative number!"); } else { acc += n; } } // デバッグ用: 強制的にaccを負の値に設定 if (acc >= 1000) { acc = -1; } } printf("You win! acc = %d\n", acc); system("cat ./flag.txt");
}
3 months ago
Chat gpt helped me whit this
7 months ago
Solved without downloading the source file : )
8 months ago
Yooooooooooo, tambah tambah tambah sampai mentok
1 year ago
im honestly about to give up
Don't. Try and read about certain datatypes!
1 month ago
include <stdlib.h>
include <stdio.h>
int main(){ setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stdin, NULL, _IONBF, 0);
}