Skip to content

Commit

Permalink
9.c
Browse files Browse the repository at this point in the history
  • Loading branch information
looosemycoool committed May 30, 2024
1 parent d9d74d4 commit bc860aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions c/9.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
#include <stdio.h>

int main() {
int n, sum;

while (1) {
int n, sum;

while(1) {
scanf("%d", &n);

if (n > 0) {
sum = 0;
for (int i = 1; i <= n; i++) {
sum += i;
if(n > 0) {
sum = 0;
for(int i = 1; i <= n; i++) {
sum += i;
}
printf("%d\n", sum);
break;
printf("%d\n", sum);
break;
} else {
printf("X\n");
printf("X\n");
}
}
return 0;
}

}
Binary file modified c/9.exe
Binary file not shown.

0 comments on commit bc860aa

Please sign in to comment.