View Code of Problem 43

#include <bits/stdc++.h>
using namespace std;

int main()
{	string s1;
	while(cin>>s1) {
		string s2;
		for(int i=0;i<s1.length();i++)	{
			if((s1[i]>='a'&&s1[i]<='z')||(s1[i]>='A'&&s1[i]<='Z'))
				s2+=s1[i];
		}
		cout<<s2<<endl;
	}
	return 0;
 } 

Double click to view unformatted code.


Back to problem 43