showcase


私信TA

用户名:1314xcx

访问量:19155

签 名:

等  级
排  名 153
经  验 7031
参赛次数 1
文章发表 70
年  龄 0
在职情况 学生
学  校 霍格沃斯-斯莱特林学院
专  业 计算机科学与技术

  自我简介:

TA的其他文章



注意事项:很菜鸟的做法。直接用字符数组来存储了。应该就是考一下判断语句的使用吧!

参考代码:

#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	char str[100];
	while(cin>>str)
	{
		if(strlen(str)==3&&str[0]=='E'&&str[1]=='N'&&str[2]=='D') 
		 break;
		else
		{
			for(int i=0;i<strlen(str);i++) 
			{
				if(str[i]=='A'||str[i]=='W'||str[i]=='F')
					str[i]='I';
				else
				if(str[i]=='C')
					str[i]='L';
				else
				if(str[i]=='M')
					str[i]='o';
				else
				if(str[i]=='S')
					str[i]='v';
				else
				if(str[i]=='D'||str[i]=='P'||str[i]=='G'||str[i]=='B')
					str[i]='e';
				else
				if(str[i]=='L')
					str[i]='Y';
				else
				if(str[i]=='X')
					str[i]='u';
			}
			
		}
		cout<<str<<endl;
	}
	return 0;
}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区