foo.cpp: In function 'int main()':
foo.cpp:32:15: error: expected ')' before numeric constant
a1[i] = (a1[i]10+a[j]-'0')%p1;
^
foo.cpp:33:15: error: expected ')' before numeric constant
a2[i] = (a2[i]10+a[j]-'0')%p2;
^
foo.cpp:34:15: error: expected ')' before numeric constant
a3[i] = (a3[i]10+a[j]-'0')%p3;
^
foo.cpp:35:15: error: expected ')' before numeric constant
a4[i] = (a4[i]10+a[j]-'0')%p4;
^
foo.cpp:107:24: error: expression cannot be used as a function
(can3[x%p3]) && (can4[x%p4]))
^
foo.cpp:16:9: warning: unused variable 'k' [-Wunused-variable]
int i,j,k;
^