记录详情

Compile Error

/in/foo.cc: In function 'int Clever(float*)':
/in/foo.cc:3:17: error: expected ']' before ';' token
 #define MAX 1000;
                 ^
/in/foo.cc:7:10: note: in expansion of macro 'MAX'
  float a[MAX];
          ^~~
/in/foo.cc:7:13: error: expected primary-expression before ']' token
  float a[MAX];
             ^
/in/foo.cc:3:17: error: expected ']' before ';' token
 #define MAX 1000;
                 ^
/in/foo.cc:8:9: note: in expansion of macro 'MAX'
  cin>>a[MAX];
         ^~~
/in/foo.cc:8:12: error: expected primary-expression before ']' token
  cin>>a[MAX];
            ^
/in/foo.cc:10:12: warning: 'sizeof' on array function parameter 'a' will return size of 'float*' [-Wsizeof-array-argument]
  i=sizeof(a);
            ^
/in/foo.cc:5:20: note: declared here
 int Clever(float a[])
                    ^
/in/foo.cc:11:5: error: invalid operands of types 'float*' and 'int' to binary 'operator%'
  j=a%3;
    ~^~
/in/foo.cc: In function 'int main()':
/in/foo.cc:3:17: error: expected ']' before ';' token
 #define MAX 1000;
                 ^
/in/foo.cc:27:10: note: in expansion of macro 'MAX'
  float a[MAX];
          ^~~
/in/foo.cc:27:13: error: expected primary-expression before ']' token
  float a[MAX];
             ^
/in/foo.cc:28:7: error: 'a' was not declared in this scope
  cin>>a[MAX];
       ^
/in/foo.cc:3:17: error: expected ']' before ';' token
 #define MAX 1000;
                 ^
/in/foo.cc:28:9: note: in expansion of macro 'MAX'
  cin>>a[MAX];
         ^~~
/in/foo.cc:28:12: error: expected primary-expression before ']' token
  cin>>a[MAX];
            ^
/in/foo.cc:3:17: error: expected ']' before ';' token
 #define MAX 1000;
                 ^
/in/foo.cc:29:11: note: in expansion of macro 'MAX'
  Clever(a[MAX]);
           ^~~
/in/foo.cc:29:14: error: expected primary-expression before ']' token
  Clever(a[MAX]);
              ^

信息

递交者
类型
递交
题目
谁更聪明?
比赛
2019-1-24寒假集训3
语言
C++
递交时间
2019-01-24 11:25:45
评测时间
2019-01-24 14:03:19
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes