Search found 1 match

by irtizaur
Sun Jan 03, 2010 11:30 am
Forum: Volume 4 (400-499)
Topic: 458 - The Decoder
Replies: 71
Views: 25301

458 - what's wrong with this code? :(

i am continuously getting WA. I can't figure the problem :( somebody help...

Code: Select all

#include <iostream>
using namespace std;
int main()
{
	char ch;
	while(cin>>ch)
	{
		if(ch=='\n'||ch=='\r')
		{
			cout<<ch;
		}
		else
		{
			ch = (char)(ch - 7);
			cout<<ch;
		}
	}
	return 0;
}

Go to advanced search