有人在hihocoder上学习的吗?

最近在hihocoder上面学习编程C/C++,但是发现了一些很奇怪的错误。下面这里是题库中第二题的代码,我在VS2010上面compile了没有问题,也可以运行,但是为什么放到了hihocoder上面就会有错误呢?大家谁能够帮助我吗?谢谢啦!下面第一个回复是我的代码,大家可以自己试一试~

#include
#include

char word[10];

struct TrieNode
{
TrieNode *child[26];
int num;
TrieNode()
{
num = 0;
memset(child, NULL, sizeof(child));
}
};

TrieNode *root;
int temp;

void Build(char* s)
{
TrieNode *p = root;
for(int i = 0; s[i]!=0; i++)
{
temp = s[i]-'a';
if(p->child[temp] == NULL)
{
p->child[temp] = new TrieNode;
}
p = p->child[temp];
p->num ++;
}
}

int check(char* s)
{
TrieNode *p = root;
for(int i = 0; s[i]!=0; i++)
{
temp = s[i]-'a';
if(p->child[temp] == NULL)
return 0;
p = p->child[temp];
}
return p->num;
}

int main()
{
int n, m;
scanf("%d", &n);
root = new TrieNode;
while(n--)
{
scanf("%s",word);
Build(word);
}

scanf("%d", &m);
while(m--)
{
    scanf("%s",word);
    printf("%d\n",check(word));
}

return 0;

}

好吧,我来自己回答一下。hihocoder里面的编译器有GCC和G++等其他的种类,只要选择G++就可以通过了。祝大家编程愉快!