首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

一道ACM水题不知道如何WA的

2012-03-16 
一道ACM水题不知道怎么WA的http://acm.hdu.edu.cn/showproblem.php?pid1219HDOJ 1219不知道为什么会WA#in

一道ACM水题不知道怎么WA的
http://acm.hdu.edu.cn/showproblem.php?pid=1219 HDOJ 1219不知道为什么会WA
#include<stdio.h>
#include<string.h>
int main()
{
  char c[100010],a[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
  int b[26]={};
  while(gets(c))
  {  
  memset(b,0,sizeof(int));
  for(int i=0;c[i];i++)
  {
  for(int j=0;j<26;j++)
  {
  if(a[j]==c[i])
  b[j]++;
  }
  }
  for(int i=0;i<26;i++)
  {
  printf("%c:%d\n",a[i],b[i]);
  }
  printf("\n");  
  }
}


[解决办法]
memset(b,0,sizeof(int));
[解决办法]
应该是sizeof(b)

热点排行