/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:4:63: error: array must be initialized with a brace-enclosed initializer
 {   int n,mid,mid2,m,i,j,ans,time;bool x,above=false,up[1000]=true;
                                                               ^~~~
/in/foo.cc:13: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:14: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:14: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:14: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:14: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:14: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:15: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:15: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:15: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:17: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:20:10: error: expected '(' before 'above'
    while above==false;
          ^~~~~
/in/foo.cc:20:22: error: expected ')' before ';' token
    while above==false;
                      ^

信息

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