/ Vijos /

记录详情

Compile Error

foo.c: In function 'main':
foo.c:15:9: error: 'for' loop initial declarations are only allowed in C99 mode
         for(int i=1;i<=n;i++)
         ^
foo.c:15:9: note: use option -std=c99 or -std=gnu99 to compile your code
foo.c:16:13: error: 'for' loop initial declarations are only allowed in C99 mode
             for(int j=1;j<=n;j++) map[i][j]=max;
             ^
foo.c:17:17: error: redefinition of 'i'
         for(int i=1;i<=m;i++)
                 ^
foo.c:15:17: note: previous definition of 'i' was here
         for(int i=1;i<=n;i++)
                 ^
foo.c:17:9: error: 'for' loop initial declarations are only allowed in C99 mode
         for(int i=1;i<=m;i++)
         ^
foo.c:23:17: error: redefinition of 'i'
         for(int i=1;i<=n;i++)
                 ^
foo.c:17:17: note: previous definition of 'i' was here
         for(int i=1;i<=m;i++)
                 ^
foo.c:23:9: error: 'for' loop initial declarations are only allowed in C99 mode
         for(int i=1;i<=n;i++)
         ^
foo.c:24:21: error: redefinition of 'j'
             for(int j=1;j<=n;j++) dist[i][j]=map[i][j];
                     ^
foo.c:16:21: note: previous definition of 'j' was here
             for(int j=1;j<=n;j++) map[i][j]=max;
                     ^
foo.c:24:13: error: 'for' loop initial declarations are only allowed in C99 mode
             for(int j=1;j<=n;j++) dist[i][j]=map[i][j];
             ^
foo.c:26:9: error: 'for' loop initial declarations are only allowed in C99 mode
         for(int k=1;k<=n;k++)
         ^
foo.c:28:13: error: 'for' loop initial declarations are only allowed in C99 mode
             for(int i=1;i<=k-1;i++)
             ^
foo.c:29:17: error: 'for' loop initial declarations are only allowed in C99 mode
                 for(int j=i+1;j<=k-1;j++)
                 ^
foo.c:31:21: error: redefinition of 'i'
             for(int i=1;i<=n;i++)
                     ^
foo.c:28:21: note: previous definition of 'i' was here
             for(int i=1;i<=k-1;i++)
                     ^
foo.c:31:13: error: 'for' loop initial declarations are only allowed in C99 mode
             for(int i=1;i<=n;i++)
             ^
foo.c:32:25: error: redefinition of 'j'
                 for(int j=1;j<=n;j++)
                         ^
foo.c:29:25: note: previous definition of 'j' was here
                 for(int j=i+1;j<=k-1;j++)
                         ^
foo.c:32:17: error: 'for' loop initial declarations are only allowed in C99 mode
                 for(int j=1;j<=n;j++)
                 ^

信息

递交者
类型
递交
题目
P1046 观光旅游
语言
C
递交时间
2015-04-15 00:05:12
评测时间
2015-04-15 00:05:14
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes