求C语言编一个程序??

[复制链接]
查看11 | 回复0 | 2006-10-2 10:07:18 | 显示全部楼层 |阅读模式
正在做,要点时间#include #include int main(){ int choice=0; char str1[100],str2[100]; while(1) {printf("*************************************** \n");printf("* 1.字符串倒序 * \n");printf("* 2.字符串连接 *\n");printf("* 3.退出 *\n ");printf("***************************************\n");printf("请选择:\n");fflush(stdin);scanf("%d",&choice);if(choice==1){ printf("输入字符串:"); fflush(stdin); gets(str1); strrev(str1); printf("\n倒序结果为:"); printf("%s(任意键返回到菜单界面)",str1); choice=0; getchar(); continue;}else if(choice==2){ printf("输入字符串1:"); fflush(stdin); gets(str1); printf("输入字符串2:"); gets(str2); strcat(str1,str2); printf("连接结果为:%s(任意键返回到菜单界面)",str1); choice=0; getchar(); continue;}else if(choice==3){ break;}
else{ choice=0; continue;} }}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行