Compile Error
foo.c: In function 'main': foo.c:15:13: error: 'sum' undeclared (first use in this function) 15 | int b =(sum*T); | ^~~ foo.c:15:13: note: each undeclared identifier is reported only once for each function it appears in
Code
#include<stdio.h>
int main()
{ int T;
scanf("%d", &T);
while(T--){
int a;
scanf("%d",&a);
int sum=0;
for(int i=a; i<=a-1; i++){
sum+=i;
}
}
int b =(sum*T);
printf("%d",b);
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1105 Ohh that gcd again
- Contest
- LUCC Presents Kick & Code Intra LU Programming Contest
- Language
- C11 (GCC 13.2.0)
- Submit At
- 2025-09-01 06:59:38
- Judged At
- 2025-09-01 06:59:38
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes