记录详情

Compile Error

/in/foo.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
 canf("%lf%lf%lf%lf%d", &D1, &C, &D2, &P, &N);
     ^
/in/foo.cc:2:1: error: expected unqualified-id before numeric constant
 12 
 ^~
/in/foo.cc:6:1: error: expected unqualified-id before numeric constant
 16     double  price[MAX_NUM];
 ^~
/in/foo.cc:7:1: error: expected unqualified-id before numeric constant
 17 
 ^~
/in/foo.cc:9:1: error: expected unqualified-id before numeric constant
 19     price[0] = P;                //起点的油价 
 ^~
/in/foo.cc:10:1: error: expected unqualified-id before numeric constant
 20     distance[N+1] = D1;            //终点为最后一个加油站 
 ^~
/in/foo.cc:11:1: error: expected unqualified-id before numeric constant
 21     price[N+1] = 0;                //终点价格 
 ^~
/in/foo.cc:12:1: error: expected unqualified-id before numeric constant
 22 
 ^~
/in/foo.cc:14:1: error: expected unqualified-id before numeric constant
 24     double surplus=0;            //到第i个加油站的时候的剩余油量 
 ^~
/in/foo.cc:15:1: error: expected unqualified-id before numeric constant
 25     double maxDis = C * D2;        //加满油行使的最大距离 
 ^~
/in/foo.cc:16:1: error: expected unqualified-id before numeric constant
 26     bool flag = true;            //是否有解,默认有解 
 ^~
/in/foo.cc:17:1: error: expected unqualified-id before numeric constant
 27     
 ^~
/in/foo.cc:18:23: error: 'i' does not name a type
 28     for (int i = 1;i <= N; i++)
                       ^
/in/foo.cc:18:31: error: 'i' does not name a type
 28     for (int i = 1;i <= N; i++)
                               ^
/in/foo.cc:26:1: error: expected unqualified-id before numeric constant
 36     
 ^~
/in/foo.cc:32:1: error: expected unqualified-id before numeric constant
 42 
 ^~
/in/foo.cc:37:27: error: 'i' does not name a type
 47     for (int i = 0, j; i <= N; i = j)    //到达j之后,将j赋值给i,重新循环,知道到达终点 
                           ^
/in/foo.cc:37:35: error: 'i' does not name a type
 47     for (int i = 0, j; i <= N; i = j)    //到达j之后,将j赋值给i,重新循环,知道到达终点 
                                   ^
/in/foo.cc:71:1: error: expected unqualified-id before numeric constant
 81     
 ^~
/in/foo.cc:73:1: error: expected unqualified-id before numeric constant
 83         
 ^~
/in/foo.cc:75:1: error: expected unqualified-id before numeric constant
 85 }
 ^~
/in/foo.cc:75:4: error: expected declaration before '}' token
 85 }
    ^

信息

递交者
类型
递交
题目
#2 出行预算
题目数据
下载
语言
C++
递交时间
2018-11-08 20:36:52
评测时间
2018-11-08 20:36:55
评测机
分数
0
总耗时
10ms
峰值内存
2.789 MiB