foo.cc:6:129: error: stray '#' in program
{ return 0; } } return 1;}int main(){ int n,m; int *a; while(scanf("%d%d",&n,&m)!=EOF) { if(n==-1&&m==-1) ... #include<stdio.h>#include<stdlib.h>int panduan(int *a,int m){ int i; for(i=0;i<m;i++) { if(a[i]==0) { return 0; } } return 1;}int main(){ int n,m; int *a; while(scanf("%d%d",&n,&m)!=EOF) { if(n==-1&&m==-1) break; a=new int[n]; int i,j; for(i=0;i<n;i++) a[i]=0; int t=0; while(1) { if(a[t]==1) break; else a[t]=1; if(m>n) m=m%n; if(t+m>n) t=m-(n-t); else t=m+t; } if(panduan(a,m)) printf("YES\n"); else printf("POOR Haha\n"); delete []a; } return 0; }
^
foo.cc:6:146: error: stray '#' in program
{ return 0; } } return 1;}int main(){ int n,m; int *a; while(scanf("%d%d",&n,&m)!=EOF) { if(n==-1&&m==-1) ... #include<stdio.h>#include<stdlib.h>int panduan(int *a,int m){ int i; for(i=0;i<m;i++) { if(a[i]==0) { return 0; } } return 1;}int main(){ int n,m; int *a; while(scanf("%d%d",&n,&m)!=EOF) { if(n==-1&&m==-1) break; a=new int[n]; int i,j; for(i=0;i<n;i++) a[i]=0; int t=0; while(1) { if(a[t]==1) break; else a[t]=1; if(m>n) m=m%n; if(t+m>n) t=m-(n-t); else t=m+t; } if(panduan(a,m)) printf("YES\n"); else printf("POOR Haha\n"); delete []a; } return 0; }
^
foo.cc: In function 'int main()':
foo.cc:6:125: error: expected primary-expression before '...' token
{ return 0; } } return 1;}int main(){ int n,m; int *a; while(scanf("%d%d",&n,&m)!=EOF) { if(n==-1&&m==-1) ... #include<stdio.h>#include<stdlib.h>int panduan(int *a,int m){ int i; for(i=0;i<m;i++) { if(a[i]==0) { return 0; } } return 1;}int main(){ int n,m; int *a; while(scanf("%d%d",&n,&m)!=EOF) { if(n==-1&&m==-1) break; a=new int[n]; int i,j; for(i=0;i<n;i++) a[i]=0; int t=0; while(1) { if(a[t]==1) break; else a[t]=1; if(m>n) m=m%n; if(t+m>n) t=m-(n-t); else t=m+t; } if(panduan(a,m)) printf("YES\n"); else printf("POOR Haha\n"); delete []a; } return 0; }
^~~
foo.cc:8:40: error: a function-definition is not allowed here before '{' token
foo.cc:11:72: error: expected '}' at end of input
foo.cc:6:68: warning: unused variable 'a' [-Wunused-variable]
{ return 0; } } return 1;}int main(){ int n,m; int *a; while(scanf("%d%d",&n,&m)!=EOF) { if(n==-1&&m==-1) ... #include<stdio.h>#include<stdlib.h>int panduan(int *a,int m){ int i; for(i=0;i<m;i++) { if(a[i]==0) { return 0; } } return 1;}int main(){ int n,m; int *a; while(scanf("%d%d",&n,&m)!=EOF) { if(n==-1&&m==-1) break; a=new int[n]; int i,j; for(i=0;i<n;i++) a[i]=0; int t=0; while(1) { if(a[t]==1) break; else a[t]=1; if(m>n) m=m%n; if(t+m>n) t=m-(n-t); else t=m+t; } if(panduan(a,m)) printf("YES\n"); else printf("POOR Haha\n"); delete []a; } return 0; }
^
foo.cc:11:72: error: expected '}' at end of input
自豪的采用jd5进行评测(github.com/masnn/jd5)