Problem addk
User Xiaoyang
Submission Time 2023-01-04 14:11:35
Score 0
Max Time N/A
Max Memory N/A

Compile Error

addk.cpp: In function ‘int main()’:
addk.cpp:51:5: error: expected primary-expression before ‘if’
51 | (if k!=0)rep(i,1,n+1)pre[i]=pre[i-1]+alist[i];
| ^~
addk.cpp:51:5: error: expected ‘)’ before ‘if’
51 | (if k!=0)rep(i,1,n+1)pre[i]=pre[i-1]+alist[i];
| ~^~
| )
addk.cpp:51:17: error: ‘i’ was not declared in this scope
51 | (if k!=0)rep(i,1,n+1)pre[i]=pre[i-1]+alist[i];
| ^
addk.cpp:8:41: note: in definition of macro ‘rep’
8 | #define rep(i,a,b) for (long long i=(a);i<(b);i++)
| ^