Problem K: 零起点学算法107——统计元音
#include<stdio.h>
int main()
{
int n;
char a[];
while(scanf("%d%*c",&n)!=EOF)
{
while(n--)
{
int num1=,num2=,num3=,num4=,num5=;
gets(a);
for(int i=;a[i]!='\0';i++)
{
switch(a[i]) //在这用switch语句会比较方便
{
case 'a': num1++;break;
case 'e': num2++;break;
case 'i': num3++;break;
case 'o': num4++;break;
case 'u': num5++;break;
}
}
printf("a:%d\ne:%d\ni:%d\no:%d\nu:%d\n\n",num1,num2,num3,num4,num5);
} }
return ;
}
Problem K: 零起点学算法107——统计元音的更多相关文章
- Problem F: 零起点学算法101——统计字母数字等个数
#include<stdio.h> #include<string.h> int main(){ ]; while(gets(str)!=NULL){ ,b=,c=,d=; ; ...
- 武汉科技大学ACM :1003: 零起点学算法67——统计字母数字等个数
Problem Description 输入一串字符,统计这串字符里的字母个数,数字个数,空格字数以及其他字符(最多不超过100个字符) Input 多组测试数据,每行一组 Output 每组输出一行 ...
- Problem H: 零起点学算法109——单数变复数
#include <stdio.h> #include<string.h> int main(void) { int n; ]; scanf("%d",&a ...
- Problem G: 零起点学算法106——首字母变大写
#include<stdio.h> #include<string.h> int main(void) { ]; int i,k; while(gets(a)!=NULL) { ...
- Problem H: 零起点学算法103——查找最大元素
#include<stdio.h> #include<string.h> int main() { ]; while(gets(a)!=NULL) { ]; ;a[i]!='\ ...
- Problem J: 零起点学算法89——程序设计竞赛
#include<stdio.h> //选择排序法 int main(){ ]; while(scanf("%d",&n)!=EOF){ ;i<n;i++ ...
- Problem F: 零起点学算法85——数组中插入一个数
#include<stdio.h> int main() { ],b[]; while(scanf("%d",&n)!=EOF) { ;i<n;i++) ...
- Problem D: 零起点学算法95——弓型矩阵
#include<stdio.h> #include<string.h> int main() { ][]; while(scanf("%d%d",& ...
- Problem F: 零起点学算法42——多组测试数据输出II
#include<stdio.h> int main() { ; while(scanf("%d%d%d",&a,&b,&c)!=EOF) { ...
随机推荐
- AndroidStudio获得发布版安全码SHA1
耗了一下午才搞定 在cmd中: 1.打开keytool的目录:即JDK的安装目录 2.输入口令: (E:\tenyears\tenyears\app是keystore文件的目录)
- mave的依赖范围
compile(编译范围) compile是默认的范围:如果没有提供一个范围,那该依赖的范围就是编译范 围.编译范围依赖在所有的classpath中可用,同时它们也会被打包. provided(已提供 ...
- 9.0docker的数据管理
dopcker容器的数据卷 为容器添加数据卷 sudo docker run -v ~/container data:/data -it ubuntu /bin/bash 查 ...
- HDU 6183 Color it 线段树
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6183 题意: 有四种操作: 0:清除所有点 1 x y c : 给点(x, y)添加一种颜色c(颜色不 ...
- 2017多校第9场 HDU 6166 Senior Pan 堆优化Dij
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6166 题意:给你一个有向图,然后给你k个点,求其中一个点到另一个点的距离的最小值. 解法:枚举二进制位 ...
- ajax之深入解析(2)
我们前面实现了用原生的JavaScript代码实现ajax的异步数据传输.接下来,我们再使用一个流行的js框架jQuery来实现ajax. 通过 jQuery AJAX 方法,我们能够使用 HTTP ...
- Leetcode 之Same Tree(48)
用递归比较简单,这里用迭代的方式实现.注意什么时候返回true,什么时候返回false. bool isSameTree(TreeNode *p, TreeNode *q) { stack<Tr ...
- 如何生成[0,maxval]范围内m个随机整数的无重复的有序序列
在这里我们将待生成的数据结构称为IntSet,接口定义如下: class IntSetImp { public: IntSetImp(int maxelements,int maxval); void ...
- y=y||'world'与y=y?y:'world'
1.y=y||’world’ function log(x,y){ y=y||’world’; console.log(x,y) } log(‘hello’)===>hello world lo ...
- LeetCode解题报告—— Swap Nodes in Pairs & Divide Two Integers & Next Permutation
1. Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. For e ...