Skip to content

Commit 1604db4

Browse files
committed
Solve Exceeding Z in c
1 parent 37752d7 commit 1604db4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

solutions/beecrowd/1150/1150.c

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <stdint.h>
2+
#include <stdio.h>
3+
4+
int main() {
5+
int16_t x, s = 0, z, n = 0;
6+
7+
scanf("%d", &x);
8+
9+
while (scanf("%d", &z) && z <= x) {
10+
}
11+
12+
for (int16_t i = x; s <= z; i++) {
13+
s += x++;
14+
n++;
15+
}
16+
17+
printf("%d\n", n);
18+
19+
return 0;
20+
}

0 commit comments

Comments
 (0)