Sunday, February 3, 2008

The Decoder : Problem No. 458

Submitted solution with Run Time = 0.330

#include<iostream>
#include<string>

using namespace std;

int main()
{
string str,nstr;
int i;

while(getline(cin,str))
{
i=0;
nstr.resize(str.size());
while(str[i])
{
nstr[i]=str[i]-7;
i++;
}
cout<<nstr<<endl;
}
return(0);
}

Do comment for better solution or any query.

No comments: