HDU 2719 The Seven Percent Solution
#include <cstdio> #include <cstring> int main() { char s[10000]; while(gets(s),s[0]!='#') { int i=0; while (i<strlen(s)) { if (s[i]==' ') printf("%s","%20"); else if (s[i]=='!') printf("%s","%21"); else if (s[i]=='$') printf("%s","%24"); else if (s[i]=='%') printf("%s","%25"); else if (s[i]=='(') printf("%s","%28"); else if (s[i]==')') printf("%s","%29"); else if (s[i]=='*') printf("%s","%2a"); else printf("%c",s[i]); i++; } printf("\n"); } return 0; }
愿你出走半生,归来仍是少年