foo.cpp:1:1: error: 'include' does not name a type
include <stdio.h>
^
foo.cpp: In function 'int main()':
foo.cpp:17:19: error: 'scanf' was not declared in this scope
scanf("%d%d",&n,&m);
^
foo.cpp:19:12: error: 'a' was not declared in this scope
scanf("%s",a);
^
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:57:23: error: 'printf' was not declared in this scope
printf("%d\n",ans1);
^
foo.cpp:61:31: error: 'memset' was not declared in this scope
memset(can1,0,sizeof(can1));
^
foo.cpp:110:23: error: 'printf' was not declared in this scope
printf("%d\n",ans1);
^
foo.cpp:16:9: warning: unused variable 'k' [-Wunused-variable]
int i,j,k;
^