【HDU】统计元音
来源:互联网 发布:防范网络钓鱼最有效 编辑:程序博客网 时间:2024/06/05 17:20
题目地址:HDU 2027
主要是因为忘了清除缓冲区的换行符还WA了一发
#include <iostream>#include <algorithm>#include <cstdlib>#include <cstdio>#include <string>#include <cstring>#include <cmath>#include <ctime>using namespace std;#define read() freopen("in.txt", "r", stdin)#define write() freopen("out.txt", "w", stdout)#define rep( i , a , b ) for ( int i = ( a ) ; i < ( b ) ; ++ i ) #define For( i , a , b ) for ( int i = ( a ) ; i <= ( b ) ; ++ i ) #define clr( a , x ) memset ( a , x , sizeof a ) #define cpy( a , x ) memcpy ( a , x , sizeof a ) #define LL long long int num1,num2,num3,num4,num5;int n;char str[200];void solve(){num1=0,num2=0,num3=0,num4=0,num5=0;rep(i,0,strlen(str)){if (str[i]=='a'){num1++;}else if (str[i]=='e'){num2++;}else if(str[i]=='i'){ num3++;}else if (str[i]=='o'){num4++;}else if (str[i]=='u'){num5++;}}if (n){printf("a:%d\ne:%d\ni:%d\no:%d\nu:%d\n\n",num1,num2,num3,num4,num5);}else{printf("a:%d\ne:%d\ni:%d\no:%d\nu:%d\n",num1,num2,num3,num4,num5);}}int main(){//read();scanf("%d",&n);getchar();while(n--){ gets(str);solve();} return 0; }
0 0
- hdu 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- Hdu 2027 - 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- hdu-统计元音
- HDU 2027 - 统计元音
- hdu-2027-统计元音
- [hdu 2027] 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- 【HDU】统计元音
- hdu 2027 统计元音
- HDU 2027 -- 统计元音
- android 图片处理总结
- PB中调取数据库填充控件DDLB代码
- 存储过程语法及实例
- LitePal学习总结 (六)
- iOS工程适配64-bit经验分享
- 【HDU】统计元音
- 【CSS3】滤镜+【html5】画布实现图片模糊效果
- WIFI的Linux驱动部分wext和nl80211
- OGC 网站
- ASP.net webClient 汇率
- $.ajax同步/异步(async:false/true)
- js foreach循环
- 黑马程序员_java抽象类和接口学习笔记
- 对HTML5至关重要的10个Javascript资源