Advertisement
Guest User

NAH

a guest
Dec 16th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. # include <string>
  3. using namespace std;
  4.  
  5. int main(){
  6.  
  7. string s;
  8. while(getline(cin,s))
  9. {
  10. if(s[0]== '#')
  11. {
  12. break;
  13. }
  14. int l = (int) s.size();
  15. for(int i=0;i < l;i++)
  16. {
  17. if(s[i] == ' ')
  18. {
  19. cout<<"%20";
  20. }
  21. else if(s[i] == '!')
  22. {
  23. cout<<"%21";
  24. }
  25. else if(s[i] == '$' )
  26. {
  27. cout<<"%24";
  28. }
  29. else if(s[i] == '%' ){
  30. cout<<"%25";
  31. }
  32. else if(s[i] == '(')
  33. {
  34. cout<<"%28";
  35. }
  36. else if(s[i] == ')')
  37. {
  38. cout<<"%29";
  39. }
  40. else if(s[i] == '*')
  41. {cout<<"%2a";
  42. }
  43. else
  44. {
  45. cout<<s[i];
  46.  
  47. }
  48. }
  49. cout<<endl;
  50. }
  51.  
  52.  
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement