F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_17982084_28785.cpp:2:3: error: expected unqualified-id before 'if'
   if(a[i]==x||(abs(k-i)==abs(x-a[i])))   {   return 0;  } }    return 1;}void dfs(int k,int end)//k表示行数 //  这里的dfs为到一步后  还有n步。{ int i; if(k>end) {  sum++;  return; } for(i=1;i<=end;i++) {  if(visit(k,i)==1)  {   a[k]=i;   dfs(k+1,end);  } }}int main(){    long long sume[110],i,n;    for(i=1;i<=10;i++) {  sum=0;  memset(a,0,sizeof(a));  if(n==0) break;  dfs(1,i);  sume[i]=sum; } while(~scanf("%I64d",&n)) {   if(n==0) break;   printf("%I64d\n",sume[n]); } return 0;}
   ^
0_0_17982084_28785.cpp:2:59: error: expected declaration before '}' token
   if(a[i]==x||(abs(k-i)==abs(x-a[i])))   {   return 0;  } }    return 1;}void dfs(int k,int end)//k表示行数 //  这里的dfs为到一步后  还有n步。{ int i; if(k>end) {  sum++;  return; } for(i=1;i<=end;i++) {  if(visit(k,i)==1)  {   a[k]=i;   dfs(k+1,end);  } }}int main(){    long long sume[110],i,n;    for(i=1;i<=10;i++) {  sum=0;  memset(a,0,sizeof(a));  if(n==0) break;  dfs(1,i);  sume[i]=sum; } while(~scanf("%I64d",&n)) {   if(n==0) break;   printf("%I64d\n",sume[n]); } return 0;}
                                                           ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-12-02 15:45:10, Gzip enabled