当前位置:网站首页>Count the number of each vowel letter in the string
Count the number of each vowel letter in the string
2022-06-26 16:44:00 【Muzi..】
#include<stdio.h>
#include<stdlib.h>
void fun(char *s,int num[5]);
int main()
{
char s1[81];
int num1[5],i;
printf("\n please enter string:");
gets(s1);
fun(s1,num1);
for(i=0;i<5;i++)
{
printf("%d",num1[i]);
}
printf("\n");
}
void fun(char *s,int num[5])
{
int k,i=5;
for(k=0;k<i;k++)
{
num[k]=0;
}
for(;*s;s++)
{
i=-1;
switch(*s)
{
case 'a': case 'A' :
{
i=0;
break;
}
case 'e': case 'E':
{
i=1;
break;
}
case 'i': case 'I':
{
i=2;
break;
}
case 'o': case'O':
{
i=3;
break;
}
case 'u': case 'U':
{
i=4;
break;
}
}
if(i>=0)
{
num[i]++;
}
}
}
边栏推荐
- 板卡的分级调试经验
- Acid of redis
- LeetCode Algorithm 24. 两两交换链表中的节点
- Experience in hierarchical debugging of boards and cards
- 基于STM32+华为云IOT设计的云平台监控系统
- Leetcode 1169. 查询无效交易(如果数据量不大,这种题还是得暴力枚举解决)
- 【力扣刷题】单调栈:84. 柱状图中最大的矩形
- When a programmer is disturbed 10 times a day, the consequences are amazing!
- Failed to upload hyperf framework using alicloud OSS
- LeetCode Algorithm 24. Exchange the nodes in the linked list in pairs
猜你喜欢

【力扣刷题】11.盛最多水的容器//42.接雨水

In a bad mood, I just write code like this
![[机缘参悟-31]:鬼谷子-抵巇[xī]篇-危机是危险与机会并存](/img/e8/9c5f1658a252c3c80503b5021917f6.jpg)
[机缘参悟-31]:鬼谷子-抵巇[xī]篇-危机是危险与机会并存

Science | 红树林中发现的巨型细菌挑战传统无核膜观念

【力扣刷题】二分查找:4. 寻找两个正序数组的中位数

建立自己的网站(16)

Junit单元测试

Cuckoo filter for Chang'an chain transaction

100+ data science interview questions and answers Summary - basic knowledge and data analysis

Cloud platform monitoring system based on stm32+ Huawei cloud IOT design
随机推荐
What is the preferential account opening policy of securities companies now? Is it safe to open an account online now?
【从删库到跑路】JDBC 完结篇(一天学完系列!!学完赶紧跑!)
[Li Kou brush question] monotone stack: 84 The largest rectangle in the histogram
Stm32f103c8t6 realize breathing lamp code
Some instance methods of mono
国内首款开源 MySQL HTAP 数据库即将发布,三大看点提前告知
Failed to upload hyperf framework using alicloud OSS
redis的二进制数组命令
day10每日3题(1):逐步求和得到正数的最小值
JS tutorial electron JS is a good tool for designing powerful multi platform desktop applications
1-12vmware adds SSH function
Niuke programming problem -- dynamic programming of must brush 101 (a thorough understanding of dynamic programming)
Science | 红树林中发现的巨型细菌挑战传统无核膜观念
Greenplum database fault analysis - semop (id=2000421076, num=11) failed: invalid argument
Gui+sqlserver examination system
Learn about common functional interfaces
Scala Foundation (2): variables et types de données
Net based on girdview control to delete and edit row data
Experience in hierarchical debugging of boards and cards
Kept to implement redis autofailover (redisha) 1