Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- # include <string>
- using namespace std;
- int main(){
- string s;
- while(getline(cin,s))
- {
- if(s[0]== '#')
- {
- break;
- }
- int l = (int) s.size();
- for(int i=0;i < l;i++)
- {
- if(s[i] == ' ')
- {
- cout<<"%20";
- }
- else if(s[i] == '!')
- {
- cout<<"%21";
- }
- else if(s[i] == '$' )
- {
- cout<<"%24";
- }
- else if(s[i] == '%' ){
- cout<<"%25";
- }
- else if(s[i] == '(')
- {
- cout<<"%28";
- }
- else if(s[i] == ')')
- {
- cout<<"%29";
- }
- else if(s[i] == '*')
- {cout<<"%2a";
- }
- else
- {
- cout<<s[i];
- }
- }
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement