/ Vijos /

记录详情

Compile Error

foo.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
 include<iostream> include<math.h> include<stdio.h>
        ^
foo.c: In function 'main':
foo.c:9:1: error: 'cin' undeclared (first use in this function)
 cin>>n>>r;
 ^
foo.c:9:1: note: each undeclared identifier is reported only once for each function it appears in
foo.c:12:1: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
 for(int i=0;i<n;i++) { cin>>x[i];
 ^
foo.c:12:1: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
foo.c:15:1: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
 for(int j=0;j<n-1;j++)
 ^
foo.c:17:1: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
 length+=sqrt(pow((x[j+1]-x[j]),2)+pow((y[j+1]-y[j]),2));
 ^
foo.c:17:9: warning: incompatible implicit declaration of built-in function 'sqrt'
 length+=sqrt(pow((x[j+1]-x[j]),2)+pow((y[j+1]-y[j]),2));
         ^
foo.c:17:1: warning: implicit declaration of function 'pow' [-Wimplicit-function-declaration]
 length+=sqrt(pow((x[j+1]-x[j]),2)+pow((y[j+1]-y[j]),2));
 ^
foo.c:17:14: warning: incompatible implicit declaration of built-in function 'pow'
 length+=sqrt(pow((x[j+1]-x[j]),2)+pow((y[j+1]-y[j]),2));
              ^
foo.c:19:9: warning: incompatible implicit declaration of built-in function 'sqrt'
 length+=sqrt(pow((x[0]-x[n-1]),2)+pow((y[0]-y[n-1]),2));
         ^
foo.c:19:14: warning: incompatible implicit declaration of built-in function 'pow'
 length+=sqrt(pow((x[0]-x[n-1]),2)+pow((y[0]-y[n-1]),2));
              ^
foo.c:20:9: error: invalid suffix "pir" on integer constant
 length+=2pir;
         ^
foo.c:21:1: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
 printf("%.2f",length);
 ^
foo.c:21:1: warning: incompatible implicit declaration of built-in function 'printf'
foo.c:8:8: warning: unused variable 'pi' [-Wunused-variable]
 double pi=3.1415926535898;
        ^

信息

递交者
类型
递交
题目
P1007 绕钉子的长绳子
语言
C
递交时间
2015-08-25 16:04:48
评测时间
2015-08-25 16:04:48
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes