/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:14:34: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   for(i=1;i<=n;i++) if(up[i]=true) up[i]=false; else up[i]=true;
                                  ^
/in/foo.cc:15:14: error: expected identifier before '(' token
  if(n%2!=0)&&(n>1) for(j=1;j<mid;j++) {x=up[mid+j];up[mid+j]=up[mid-j];up[mid-j]=x;}
              ^
/in/foo.cc:15:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  if(n%2!=0)&&(n>1) for(j=1;j<mid;j++) {x=up[mid+j];up[mid+j]=up[mid-j];up[mid-j]=x;}
  ^~
/in/foo.cc:15:28: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
  if(n%2!=0)&&(n>1) for(j=1;j<mid;j++) {x=up[mid+j];up[mid+j]=up[mid-j];up[mid-j]=x;}
                            ^
/in/foo.cc:15:29: warning: statement has no effect [-Wunused-value]
  if(n%2!=0)&&(n>1) for(j=1;j<mid;j++) {x=up[mid+j];up[mid+j]=up[mid-j];up[mid-j]=x;}
                            ~^~~~
/in/foo.cc:15:37: error: expected ';' before ')' token
  if(n%2!=0)&&(n>1) for(j=1;j<mid;j++) {x=up[mid+j];up[mid+j]=up[mid-j];up[mid-j]=x;}
                                     ^
/in/foo.cc:16:3: error: 'else' without a previous 'if'
   else if(n%2=0) {mid2=n/2;for(i=1;i<mid2;i++) {x=up[n-i+1];up[n-i+1]=up[i];up[i]=x} }
   ^~~~
/in/foo.cc:16:15: error: lvalue required as left operand of assignment
   else if(n%2=0) {mid2=n/2;for(i=1;i<mid2;i++) {x=up[n-i+1];up[n-i+1]=up[i];up[i]=x} }
               ^
/in/foo.cc:16:84: error: expected ';' before '}' token
   else if(n%2=0) {mid2=n/2;for(i=1;i<mid2;i++) {x=up[n-i+1];up[n-i+1]=up[i];up[i]=x} }
                                                                                    ^
/in/foo.cc:18:34: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   for(j=1;j<=m;j++) if(up[j]=true) ans++;
                                  ^
/in/foo.cc:22:5: error: expected ';' before 'cout'
     cout<<time;
     ^~~~

信息

递交者
类型
递交
题目
P1506 翻硬币
语言
C++
递交时间
2019-07-24 10:50:36
评测时间
2019-07-24 10:50:36
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes