Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
115912 | 夏梓瑞 | 字符串展开 | C++ | Wrong Answer | 1 MS | 268 KB | 1639 | 2025-04-05 16:03:34 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min()\fabs() #include<ctime> #include<cstdlib> #include<cstring> using namespace std; char a[101]; char t; int p1,p2,p3; int main(){ cin>>p1>>p2>>p3>>a; for(int i=0;i<strlen(a);i++){ if(a[i]=='-' && a[i+1]-a[i-1]>1){ t=a[i-1]+1; if(p1==2) t-=32; if(p3==1){ for(int k=1;k<=a[i+1]-a[i-1]-1;k++){ for(int j=1;j<=p2;j++){ if(p1==3) cout<<'*'; else cout<<t; } t++; } } else{ t=a[i+1]-1; for(int k=1;k<=a[i+1]-a[i-1]-1;k++){ for(int j=1;j<=p2;j++){ if(p1==3) cout<<'*'; else cout<<t; } t--; } } } else cout<<a[i]; } return 0; }
------Input------
3 4 2 di-jkstra2-6
------Answer-----
dijkstra2************6
------Your output-----
di-jkstra2************6