1 #include<iostream> 2 #include<string> 3 using namespace std; 4 int main() 5 { 6 int i=0; 7 string s; 8 while(getline(cin,s)) 9 { 10 if (s[0]==‘#‘) break; 11 else 12 { 13 for (i=0;i<s.size();i++) 14 { 15 if (s[i]==‘ ‘) cout<<"%20"; 16 else if (s[i]==‘!‘) cout<<"%21"; 17 else if (s[i]==‘$‘) cout<<"%24"; 18 else if (s[i]==‘%‘) cout<<"%25"; 19 else if (s[i]==‘(‘) cout<<"%28"; 20 else if (s[i]==‘)‘) cout<<"%29"; 21 else if (s[i]==‘*‘) cout<<"%2a"; 22 else cout<<s[i]; 23 } 24 cout<<endl; 25 s.clear(); 26 } 27 } 28 }
1029 The Seven Percent Solution
ZOJ:2932
时间: 2024-12-15 10:06:19