foo.c:1:1: error: unknown type name 'using'
using namespace std;
^
foo.c:1:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
using namespace std;
^
foo.c:3:1: error: unknown type name 'bool'
bool cheak(int x){
^
foo.c: In function 'cheak':
foo.c:6:5: error: 'for' loop initial declarations are only allowed in C99 mode
for (int i=0;i<=n;i++)
^
foo.c:6:5: note: use option -std=c99 or -std=gnu99 to compile your code
foo.c: In function 'main':
foo.c:15:5: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
scanf("%d%d%d",&L,&n,&m);
^
foo.c:15:5: warning: incompatible implicit declaration of built-in function 'scanf' [enabled by default]
foo.c:16:5: error: 'for' loop initial declarations are only allowed in C99 mode
for (int i=0;i<n;i++)scanf("%d",&a[i]);
^
foo.c:25:5: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
printf("%d",ans);
^
foo.c:25:5: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default]