#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char str[100];
while(gets(str))
{
if(str[0] == '#')
break;
int length = strlen(str);
for(int i = 0; i < length; i++)
{
switch(str[i])
{
case ' ':
cout << "%20";
break;
case '!':
cout << "%21";
break;
case '$':
cout << "%24";
break;
case '%':
cout << "%25";
break;
case '(':
cout << "%28";
break;
case ')':
cout << "%29";
break;
case '*':
cout << "%2a";
break;
default:
cout << str[i];
}
}
cout << endl;
}
return 0;
}
杭电ACM2719——The Seven Percent Solution
最新推荐文章于 2019-01-13 14:48:13 发布