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_13801550_14657.cpp:1:9: error: #include expects "FILENAME" or <FILENAME>
 #include#include#include#includeusing namespace std;char str[12];const int maxn=26;//孩子节点的最大个数,如果是只有26个字母,就用26就可以了。struct Trie//树的结构体{    int cnt;//保存某个字母出现的次数    Trie *next[maxn];//每一个节点对应着多少个孩子,如果只有26个字母,就用26就可以了};Trie root;/*void init(Trie t){    for(int i=0;inext[id]==NULL)//第一次遇到        {            q=(Trie*)malloc(sizeof(Trie));            q-cnt=1;//此处一开始写错,写成了q-cnt++;            for(int i=0;inext[i]=NULL;//初始化非空节点的孩子节点            p-next[id]=q;//在树中填上            p=p-next[id];//此时的P是不为空的节点        }        else        {            p-next[id]-cnt++;//不是第一次遇到,个数++            p=p-next[id];        }    }}int find(char *str){    int len=strlen(str);    Trie *p=&root;    for(int i=0;inext[id];//一直向下走。        if(p==NULL)//找不到该单词,一开始此处写错了,写成了p-next[id]==NULL            return 0;    }    return p-cnt;}int main(){    while(gets(str)&&str[0]!='\0')    {        CreateTrie(str);    }    while(scanf("%s",str)!=EOF)    {        printf("%d\n",find(str));    }    return 0;}
         ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-02-18 23:04:25, Gzip enabled