wa的最惨的一次!直接运行错误 ,求指点

P1098 [NOIP2007 提高组] 字符串的展开

stropen()---这个函数名的问题,但我不知道为什么哎。只要用这个名字,就会被killed。 继续求助!!!
by bs0303 @ 2018-06-22 08:14:27


在洛谷的IDE上
by bs0303 @ 2018-06-22 08:15:09


```cpp #include <iostream> #include <cstdio> #include <string> using namespace std; int p1,p2,p3; string s,ans; int main() { ans=""; cin>>p1>>p2>>p3; cin>>s; for(int k=0;k<s.length();k++) { if(s[k]!='-') { cout<<s[k]; } else { switch(p1) { case 1: { if(p3==1) { if(s[k-1]<s[k+1]) { for(char a=s[k-1]+1;a<=s[k+1]-1;a++) { for(int l=1;l<=p2;l++) { if(isalpha(int(a))) { a=tolower(int(a)); } cout<<a; } } } else { cout<<"-"; } } if(p3==2) { if(s[k-1]<s[k+1]) { for(char a=s[k+1]-1;a>=s[k-1]+1;a--) { for(int l=1;l<=p2;l++) { if(isalpha(int(a))) { a=tolower(int(a)); } cout<<a; } } } else { cout<<"-"; } } break; } case 2: { if(p3==1) { if(s[k-1]<s[k+1]) { for(char a=s[k-1]+1;a<=s[k+1]-1;a++) { for(int l=1;l<=p2;l++) { if(isalpha(int(a))&&islower(int(a))) { a=toupper(int(a)); } cout<<a; } } } else { cout<<"-"; } } if(p3==2) { if(s[k-1]<s[k+1]) { for(char a=s[k+1]-1;a>=s[k-1]+1;a--) { for(int l=1;l<=p2;l++) { if(isalpha(int(a))) { a=toupper(int(a)); } cout<<a; } } } else { cout<<"-"; } } break; } case 3: { if(p3==1) { if(s[k-1]<s[k+1]) { for(char a=s[k-1]+1;a<=s[k+1]-1;a++) { for(int l=1;l<=p2;l++) { cout<<"*"; } } } else { cout<<"-"; } } if(p3==2) { if(s[k-1]<s[k+1]) { for(char a=s[k+1]-1;a>=s[k-1]+1;a--) { for(int l=1;l<=p2;l++) { cout<<"*"; } } } else { cout<<"-"; } } break; } default:break; } } } //cout<<" "; } ``` #WA...
by 我很辣ji看签名 @ 2018-07-07 21:10:40


@[bs0303](/space/show?uid=98064) 换一个
by si_ji @ 2018-07-12 18:50:20


@[wyp2017](/space/show?uid=82950) 换个名确实就好了
by bs0303 @ 2018-09-20 07:27:54


|