Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3610 | 邓小龙 | 字符串展开 | C++ | Accepted | 0 MS | 264 KB | 594 | 2024-06-21 22:27:38 |
#include<iostream> #include<cmath> using namespace std; int main(){ int p1,p2,p3,i,x; char ch[300]; char man,out,u,v,w; scanf("%d%d%d%s",&p1,&p2,&p3,ch); i=0; while(ch[i]){ man=ch[i-1];out=ch[i+1];u=ch[i]; if(u=='-'&&out>man&&(man>='0'&&out<='9'||man>='a'&&out<='z')){ for(p3==1?v=man+1:v=out-1;p3==1?v<out:v>man;p3==1?v++:v--){//网上查到的 w=v; if(p1==2) w=(w>='a')?w-32:w;//网上查到的 else if(p1==3) w='*'; for(x=0;x<p2;x++) printf("%c",w); } } else printf("%c",u); i++; } return 0; }