Compile Error
foo.c: In function 'main': foo.c:11:12: error: 'N' undeclared (first use in this function) 11 | sum= sum+N; | ^ foo.c:11:12: note: each undeclared identifier is reported only once for each function it appears in
Code
#include<stdio.h>
#include<string.h>
int main(){
char str[100];
scanf("%d", str);
for(int i=0; str[i]!='\0'; i++){
int N;
scanf("%d", &N);
}
int sum=0;{
sum= sum+N;
}
printf("%d", sum);
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1231 Busy Friend
- Contest
- LUCC Presents Kick & Code Intra LU Programming Contest
- Language
- C11 (GCC 13.2.0)
- Submit At
- 2025-09-01 06:39:49
- Judged At
- 2025-09-01 06:39:49
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes