不太清楚语法哪里错了?
#include <stdio.h>
#include <string.h>
int n = 1000000;
int mark[1000001];
int N, M;
int c, i;
scanf("%d,%d", &N,&M);
int main() {
int c;
memset(mark, 0, sizeof(mark));
mark[0] = 1;
mark[1] = 1;
for (c = 2; c * c <= n; c++) {
if (mark[c] != 1) /*是待筛选的数*/
{
for (i = M; i <= n / c; M++)
{
mark[c * i] = 1;
}
}
}
if (mark[c] != 1)
{
printf("%d\n", c);
}
return 0;
}
Line 8: error: expected declaration specifiers or '...' before string constant
Line 8: error: expected declaration specifiers or '...' before '&' token
Line 8: error: expected declaration specifiers or '...' before '&' token
Line 8: warning: data definition has no type or storage class
Line 8: error: conflicting types for 'scanf'