/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:18:19: error: comparison between distinct pointer types 'int*' and 'int (*)[1001]' lacks a cast [-fpermissive]
 a[i][1]+=MIN(a[1],a);
                   ^
foo.cpp:2:21: note: in definition of macro 'MIN'
 #define MIN(x,y) (x>y)?y:x
                     ^
foo.cpp:18:17: error: conditional expression between distinct pointer types 'int (*)[1001]' and 'int*' lacks a cast [-fpermissive]
 a[i][1]+=MIN(a[1],a);
                 ^
foo.cpp:2:26: note: in definition of macro 'MIN'
 #define MIN(x,y) (x>y)?y:x
                          ^
foo.cpp:18:8: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
 a[i][1]+=MIN(a[1],a);
        ^
foo.cpp:18:8: error: invalid conversion from 'void*' to 'int' [-fpermissive]
foo.cpp:23:12: error: invalid use of non-lvalue array
 if((a[i][j]+=MIN(a[j],a[j-1]))<minNum)
            ^
foo.cpp:23:12: error:   in evaluation of 'operator+=(int, int [1001])'
foo.cpp:29:23: error: comparison between distinct pointer types 'int*' and 'int (*)[1001]' lacks a cast [-fpermissive]
 if((a[i][i]+=MIN(a[1],a))<minNum)
                       ^
foo.cpp:2:21: note: in definition of macro 'MIN'
 #define MIN(x,y) (x>y)?y:x
                     ^
foo.cpp:29:21: error: conditional expression between distinct pointer types 'int (*)[1001]' and 'int*' lacks a cast [-fpermissive]
 if((a[i][i]+=MIN(a[1],a))<minNum)
                     ^
foo.cpp:2:26: note: in definition of macro 'MIN'
 #define MIN(x,y) (x>y)?y:x
                          ^
foo.cpp:29:12: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
 if((a[i][i]+=MIN(a[1],a))<minNum)
            ^
foo.cpp:29:12: error: invalid conversion from 'void*' to 'int' [-fpermissive]

信息

递交者
类型
递交
题目
P1006 晴天小猪历险记之Hill
语言
C++
递交时间
2015-05-12 07:36:44
评测时间
2015-05-12 07:36:47
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes