View Code of Problem 3308

#include<iostream>
#include<cstdio>
using namespace std;
int main() 
{	
	char zm[26]={'V','W','X','Y','Z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U'};
	string str1,str2,end;
	int n,i;
	while(getline(cin,str1))
	{
		//getchar();
		string ans;
		if(str1=="ENDOFINPUT")
			break;
		getline(cin,str2);
		getline(cin,end);
		for(i=0;i<str2.size();i++)
		{
			if(str2[i]>='A'&&str2[i]<='Z')
			{
				ans+=zm[str2[i]-'A'];
			}
			else
				ans+=str2[i];
		}
		cout<<ans<<endl;
	} 
	return 0;
}

Double click to view unformatted code.


Back to problem 3308