解题思路:
注意事项:
参考代码:
#include<stdio.h>
#include<string.h>
int main()
{
char str[33];
gets(str);
str[strlen(str)] = '\0';
int i;
if ((strlen(str) >= 2 && str[strlen(str) - 1] == 'r' && str[strlen(str) - 2] == 'e') || (strlen(str) >= 2 && str[strlen(str) - 1] == 'y' && str[strlen(str) - 2] == 'l'))
{
str[strlen(str) - 2] = '\0';
}
else if (strlen(str) >= 3 && str[strlen(str) - 1] == 'g' && str[strlen(str) - 2] == 'n' && str[strlen(str) - 3] == 'i')
str[strlen(str) - 3] = '\0';
puts(str);
return 0;
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:535 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:698 |
点我有惊喜!你懂得!浏览:1326 |
简单的a+b (C语言代码)浏览:489 |
C二级辅导-进制转换 (C语言代码)浏览:615 |
【绝对值排序】 (C++代码)浏览:670 |
字符串对比 (C语言代码)浏览:1398 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:746 |
WU-C语言程序设计教程(第三版)课后习题11.11 (C++代码)(想学链表的可以看看)浏览:1346 |
1642题解浏览:709 |