/ Vijos /

记录详情

Compile Error

foo.c: In function 'main':
foo.c:6:9: error: expected ':', ',', ';', '}' or '__attribute__' before '=' token
   int g = 0;
         ^
foo.c:11:2: error: unknown type name 'student'; use 'struct' keyword to refer to the type
  student stu[100];
  ^~~~~~~
  struct 
foo.c:13:52: error: request for member 'a' in something not a structure or union
  for (int i = 0; scanf("%s %d %d %d %d %d", &stu[i].a, &stu[i].b, &stu[i].c, &stu[i].d, &stu[i].e, &stu[i].f) != EOF;) {
                                                    ^
foo.c:13:63: error: request for member 'b' in something not a structure or union
  for (int i = 0; scanf("%s %d %d %d %d %d", &stu[i].a, &stu[i].b, &stu[i].c, &stu[i].d, &stu[i].e, &stu[i].f) != EOF;) {
                                                               ^
foo.c:13:74: error: request for member 'c' in something not a structure or union
  for (int i = 0; scanf("%s %d %d %d %d %d", &stu[i].a, &stu[i].b, &stu[i].c, &stu[i].d, &stu[i].e, &stu[i].f) != EOF;) {
                                                                          ^
foo.c:13:85: error: request for member 'd' in something not a structure or union
  for (int i = 0; scanf("%s %d %d %d %d %d", &stu[i].a, &stu[i].b, &stu[i].c, &stu[i].d, &stu[i].e, &stu[i].f) != EOF;) {
                                                                                     ^
foo.c:13:96: error: request for member 'e' in something not a structure or union
  for (int i = 0; scanf("%s %d %d %d %d %d", &stu[i].a, &stu[i].b, &stu[i].c, &stu[i].d, &stu[i].e, &stu[i].f) != EOF;) {
                                                                                                ^
foo.c:13:107: error: request for member 'f' in something not a structure or union
  for (int i = 0; scanf("%s %d %d %d %d %d", &stu[i].a, &stu[i].b, &stu[i].c, &stu[i].d, &stu[i].e, &stu[i].f) != EOF;) {
                                                                                                           ^
foo.c:14:13: error: request for member 'b' in something not a structure or union
   if (stu[i].b > 80 && stu[i].f >= 1) stu[i].g += 8000;
             ^
foo.c:14:30: error: request for member 'f' in something not a structure or union
   if (stu[i].b > 80 && stu[i].f >= 1) stu[i].g += 8000;
                              ^
foo.c:14:45: error: request for member 'g' in something not a structure or union
   if (stu[i].b > 80 && stu[i].f >= 1) stu[i].g += 8000;
                                             ^
foo.c:15:13: error: request for member 'b' in something not a structure or union
   if (stu[i].b > 85 && stu[i].c >= 80) stu[i].g += 4000;
             ^
foo.c:15:30: error: request for member 'c' in something not a structure or union
   if (stu[i].b > 85 && stu[i].c >= 80) stu[i].g += 4000;
                              ^
foo.c:15:46: error: request for member 'g' in something not a structure or union
   if (stu[i].b > 85 && stu[i].c >= 80) stu[i].g += 4000;
                                              ^
foo.c:16:13: error: request for member 'b' in something not a structure or union
   if (stu[i].b > 90) stu[i].g += 2000;
             ^
foo.c:16:28: error: request for member 'g' in something not a structure or union
   if (stu[i].b > 90) stu[i].g += 2000;
                            ^
foo.c:17:13: error: request for member 'b' in something not a structure or union
   if (stu[i].b > 85 && stu[i].e == 'Y') stu[i].g += 1000;
             ^
foo.c:17:30: error: request for member 'e' in something not a structure or union
   if (stu[i].b > 85 && stu[i].e == 'Y') stu[i].g += 1000;
                              ^
foo.c:17:47: error: request for member 'g' in something not a structure or union
   if (stu[i].b > 85 && stu[i].e == 'Y') stu[i].g += 1000;
                                               ^
foo.c:18:13: error: request for member 'b' in something not a structure or union
   if (stu[i].b > 80 && stu[i].d == 'Y') stu[i].g += 850;
             ^
foo.c:18:30: error: request for member 'd' in something not a structure or union
   if (stu[i].b > 80 && stu[i].d == 'Y') stu[i].g += 850;
                              ^
foo.c:18:47: error: request for member 'g' in something not a structure or union
   if (stu[i].b > 80 && stu[i].d == 'Y') stu[i].g += 850;
                                               ^
foo.c:20:14: error: request for member 'g' in something not a structure or union
    if (stu[i].g > stu[i - 1].g)temp = stu[i].g;
              ^
foo.c:20:29: error: request for member 'g' in something not a structure or union
    if (stu[i].g > stu[i - 1].g)temp = stu[i].g;
                             ^
foo.c:20:45: error: request for member 'g' in something not a structure or union
    if (stu[i].g > stu[i - 1].g)temp = stu[i].g;
                                             ^
foo.c:24:17: error: request for member 'g' in something not a structure or union
    temp = stu[i].g;
                 ^
foo.c:30:16: error: request for member 'g' in something not a structure or union
   sum += stu[i].g;
                ^
foo.c:32:30: error: request for member 'a' in something not a structure or union
  printf("%s\n%d\n%d", stu[ll].a, stu[ll].g, sum);
                              ^
foo.c:32:41: error: request for member 'g' in something not a structure or union
  printf("%s\n%d\n%d", stu[ll].a, stu[ll].g, sum);
                                         ^
foo.c:11:10: warning: variable 'stu' set but not used [-Wunused-but-set-variable]
  student stu[100];
          ^~~
foo.c:9:6: warning: variable 'temp' set but not used [-Wunused-but-set-variable]
  int temp;
      ^~~~
foo.c:12:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ^~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1001 谁拿了最多奖学金
语言
C
递交时间
2021-11-03 19:47:31
评测时间
2021-11-03 19:47:31
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes