/ Vijos /

记录详情

Compile Error

foo.c: In function 'main':
foo.c:6:1: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'long int *' [-Wformat=]
 while (scanf("%d%d",&n,&m)!=EOF){
 ^
foo.c:6:1: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'long int *' [-Wformat=]
foo.c:10:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for (int i=1;i<=n;i++)
 ^
foo.c:10:1: note: use option -std=c99 or -std=gnu99 to compile your code
foo.c:11:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for (int j=1;j<=n;j++){
 ^
foo.c:16:10: error: redefinition of 'i'
 for (int i=1;i<=m;i++){
          ^
foo.c:10:10: note: previous definition of 'i' was here
 for (int i=1;i<=n;i++)
          ^
foo.c:16:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for (int i=1;i<=m;i++){
 ^
foo.c:24:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for (int k=1;k<=n;k++){
 ^
foo.c:25:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for (int i=1;i<k-1;i++) if (i!=k)
 ^
foo.c:26:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for (int j=i+1;j<k;j++) if (j!=i && j!=k){
 ^
foo.c:30:10: error: redefinition of 'i'
 for (int i=1;i<=n;i++) if (i!=k)
          ^
foo.c:25:10: note: previous definition of 'i' was here
 for (int i=1;i<k-1;i++) if (i!=k)
          ^
foo.c:30:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for (int i=1;i<=n;i++) if (i!=k)
 ^
foo.c:31:10: error: redefinition of 'j'
 for (int j=1;j<=n;j++)
          ^
foo.c:26:10: note: previous definition of 'j' was here
 for (int j=i+1;j<k;j++) if (j!=i && j!=k){
          ^
foo.c:31:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for (int j=1;j<=n;j++)
 ^
foo.c:37:1: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'long long int' [-Wformat=]
 if (ans!=9999999) printf("%ld\n",ans);
 ^

信息

递交者
类型
递交
题目
P1046 观光旅游
语言
C
递交时间
2015-03-09 21:55:12
评测时间
2015-03-09 21:55:13
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes