hdu 2027 统计元音 20140728.cpp
来源:互联网 发布:网络黄金未来城网址 编辑:程序博客网 时间:2024/06/06 00:22
#include<cstdio>
#include<string.h>
int main()
{
char a[105];
int i,n,n1,n2,n3,n4,n5,len;
scanf("%d",&n);
getchar(); //吸收换行符,不然换行符会被读进去
while(n--)
{
//n1=n2=n3=n4=n5=0;
gets(a);
n1=n2=n3=n4=n5=0;
len=strlen(a);
for(i=0;i<len;i++)
{
if(a[i]=='a') n1++; //又忘记双等号
else if(a[i]=='e') n2++;
else if(a[i]=='i') n3++;
else if(a[i]=='o') n4++;
else if(a[i]=='u') n5++;
}
printf("a:%d\ne:%d\ni:%d\no:%d\nu:%d\n",n1,n2,n3,n4,n5); //最后那个换行符也要加!
if(n!=0) printf("\n");
}
//while(1);
return 0;
}
关于输出行的\n问题,无论题目是否要求输出结果之间要换行,最后那个\n都要加,这个换行是换到下一行输入的,在加换行才是题目所要求。
0 0
- hdu 2027 统计元音 20140728.cpp
- hdu 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- Hdu 2027 - 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 - 统计元音
- hdu-2027-统计元音
- [hdu 2027] 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- hdu 2027 统计元音
- HDU 2027 -- 统计元音
- HDU 2027 统计元音
- Wikioi 1017 乘积最大
- hdu 2063 过山车(匈牙利算法)
- View编程(2): invalidate()再探
- 蛰伏的辛星,必将爆发
- xampp 安装vmware后无法启动的解决方法
- hdu 2027 统计元音 20140728.cpp
- android Uri获取真实路径转换成File的方法
- java虚拟机的内存区域划分
- MemSQL Start[c]UP 2.0 - Round 1 .A
- poj1905
- 3Sum
- 刚刚学了数组,有道题不会做,求大神指教哈
- 一种比较健壮的脚本对象内存管理方案
- 关于cocos2dx的AnchorPoint