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_39353535_24114.cpp: In function 'Tritree* build_tri()':
0_0_39353535_24114.cpp:14:84: error: 'struct Tritree' has no member named 'next'
   14 | {Tritree *T=(Tritree *)malloc(sizeof(Tritree));T->count=0;for(int i=0;i<MAX;i++)T->next[i]=NULL;return T;
      |                                                                                    ^~~~
0_0_39353535_24114.cpp: In function 'void insert_tri(char*)':
0_0_39353535_24114.cpp:19:1: error: a function-definition is not allowed here before '{' token
   19 | {if(T!=NULL){for(int i=0;i<MAX;i++){if(T->next[i]!=NULL)delete_tri(T->next[i]);}}free(T);T=NULL;
      | ^
0_0_39353535_24114.cpp:21:1: error: a function-definition is not allowed here before '{' token
   21 | {int n;while(scanf("%d",&n)!=EOF){ans=0;Tri=build_tri();for(int i=0;i<n;i++){scanf("%s",a);int j=0;while(a[j]=='0')j++;      //去除数前面的无用‘0’insert_tri(a+j);}printf("%d\n",ans);delete_tri(Tri);}return 0;
      | ^
0_0_39353535_24114.cpp:22:2: error: expected '}' at end of input
   22 | }
      |  ^
0_0_39353535_24114.cpp:17:45: note: to match this '{'
   17 | {Tritree *p=Tri;for(int i=0;i<strlen(a);i++){int id=a[i]-'0';    //取a的第i个字符,注意题目中只有数字字符if(p->next[id]==NULL)p->next[id]=build_tri();p=p->next[id]; }p->count++;ans=max(ans,p->count);}
      |                                             ^
0_0_39353535_24114.cpp:22:2: error: expected '}' at end of input
   22 | }
      |  ^
0_0_39353535_24114.cpp:17:1: note: to match this '{'
   17 | {Tritree *p=Tri;for(int i=0;i<strlen(a);i++){int id=a[i]-'0';    //取a的第i个字符,注意题目中只有数字字符if(p->next[id]==NULL)p->next[id]=build_tri();p=p->next[id]; }p->count++;ans=max(ans,p->count);}
      | ^


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-11-24 02:22:55, Gzip enabled