记录详情

Compile Error

foo.c: In function 'main':
foo.c:4:12: error: stray '\357' in program
     int n,i,sum=0;
            ^
foo.c:4:13: error: stray '\274' in program
     int n,i,sum=0;
             ^
foo.c:4:14: error: stray '\214' in program
     int n,i,sum=0;
              ^
foo.c:4:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sum'
     int n,i,sum=0;
               ^~~
foo.c:8:9: error: 'i' undeclared (first use in this function)
     for(i = 2; i <= n; i++) 
         ^
foo.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
foo.c:17:9: error: 'sum' undeclared (first use in this function)
         sum+=i
         ^~~
foo.c:18:2: error: expected ';' before 'printf'
  printf("\n",sum);
  ^~~~~~
foo.c:18:13: error: stray '\357' in program
  printf("\n",sum);
             ^
foo.c:18:14: error: stray '\274' in program
  printf("\n",sum);
              ^
foo.c:18:15: error: stray '\214' in program
  printf("\n",sum);
               ^
foo.c:6:5: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ^~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A3-1 素数专题:因子的和
比赛
中北 计算机2021级专业修读指导(1)
语言
C
递交时间
2021-11-30 19:53:25
评测时间
2021-11-30 19:53:25
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes