Iiiippppkkkkppppkkkkeeee
这题目太有逼格了!!
/*复习了c++字符串的操作。*/
#include<cmath>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
#define N 2016
using namespace std;
int m,n,p;
string st;
string res;
void change(string s){int l=s.size();for (int i=0;i<l;i++){if (s[i]>='a'&&s[i]<='z') s[i]-=32;else if (s[i]>='A'&&s[i]<='Z') s[i]+=32;}res=s+"Immorta1";
}
void del(string s,string b){int p=0,lens=s.size(),lenb=b.size();string tmp;while(p<lens){if (s.substr(p,lenb)==b) p+=lenb;else tmp+=s[p],p++;}p=0;while(p<tmp.size()){if (tmp.substr(p,4)=="1013") res+="hh4742",p+=4;else res+=tmp[p],p++;}
}
void push(string a,string b){int k=abs(n-m)-1;res=a.substr(0,k);res+=b;res+=a.substr(k,a.size()-k);
}
void work(){string a=st.substr(0,m-1);string b=st.substr(m-1,st.size()-m+1);switch(n){case 1:change(st);break;case 2:del(st,b);break;case 3:push(a,b);break;}for (int i=0;i<res.size();i++)for (int j=1;j<=p+1;j++) printf("%c",res[i]);printf("n");
}
int main(){freopen("lock.in","r",stdin);freopen("lock.out","w",stdout);cin >> st;cin >> m >> n>>p;work();return 0;
}
本文发布于:2024-01-31 19:40:56,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170670125430902.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |