网站设计论文答辩问题及答案品划做网站
web/
2025/10/8 21:47:18/
文章来源:
网站设计论文答辩问题及答案,品划做网站,网站设计公司 -,如皋建设工程局网站反转字符串中的元音字符Given a string and we have to eliminate/ remove all vowels from the string using C program. 给定一个字符串#xff0c;我们必须使用C程序从字符串中消除/删除所有元音。 To eliminate/remove the vowels 消除/删除元音 We will traverse (reac…反转字符串中的元音字符Given a string and we have to eliminate/ remove all vowels from the string using C program. 给定一个字符串我们必须使用C程序从字符串中消除/删除所有元音。 To eliminate/remove the vowels 消除/删除元音 We will traverse (reach) each elements by using a loop 我们将使用循环遍历(到达)每个元素 And, check the each element, if any element found as vowel, we will remove that shifting all other elements to the left 并且检查每个元素如果发现任何元素为元音我们将删除将所有其他元素向左移动的操作 Finally, we will print the string - that will be a string without the vowels 最后我们将打印字符串-这将是没有元音的字符串 Example: 例 Input:
String is: Hello World
Output:
String after removing vowels: Hll Wrld
程序从C的字符串中消除所有元音 (Program to eliminate all vowels from the string in C)
.minHeight{
min-height: 250px;
}
@media (min-width: 1025px){
.minHeight{
min-height: 90px;
}
}
.minHeight{
min-height: 250px;
}
@media (min-width: 1025px){
.minHeight{
min-height: 90px;
}
}
/* C program to eliminate all the vowels
* from the entered string
*/
#include stdio.h
#include string.h
int main()
{
char string[50] { 0 };
int length 0, i 0, j 0, k 0, count 0;
printf(\nEnter the string : );
gets(string);
length strlen(string);
count length;
for (j 0; j length;) {
switch (string[j]) {
case a:
case A:
case e:
case E:
case i:
case I:
case o:
case O:
case u:
case U:
for (k j; k count; k) {
string[k] string[k 1];
//printf(\nstring : %s,string);
}
count--;
break;
default:
j;
}
}
string[count] \0;
printf(Final string is : %s, string);
return 0;
}
Output 输出量 Enter the string : Hello World
Final string is : Hll Wrld
翻译自: https://www.includehelp.com/c-programs/eliminate-all-vowels-from-a-string.aspx反转字符串中的元音字符
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/89279.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!