#include <iostream>
#include <string>
using namespace std;
#define CR(c,n) case c: str.replace(b,1,"%" #n); b+=2; break
string replace_all(string& str){
size_t b;
for(b=0;b<str.length();++b) {
switch ( str[b] ){
CR(' ',20);CR('!',21);CR('$',24);CR('%',25);
CR('(',28);CR(')',29);CR('*',2a);
default:break;
}
}
return str;
}
int main()
{
for(string str; getline(cin,str)&&str!="#"; cout<<replace_all(str)<<endl);
return 0;
}
Saturday, 21 March 2009
POJ ( acm.pku.edu.cn ) 3650
我爱STL
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment