80pts求助!8、9测试点wa了(玄关)

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

$你好呀!$
by hlb44 @ 2024-10-13 11:52:07


@[luojiaheng44](/user/1027418) $你的代码有问题$
by hlb44 @ 2024-10-13 11:53:27


???
by hlb44 @ 2024-10-13 11:53:58


??? 哪里有问题?
by luojiaheng44 @ 2024-10-13 11:54:16


我的代码: ```cpp #include<bits/stdc++.h> using namespace std; int p1,p2,p3; string s; int main(){ cin>>p1>>p2>>p3; cin>>s; int ls=s.size(); for(int i=0;i<ls;i++){ if((s[i]=='-')&&(s[i-1]<s[i+1])&&((isdigit(s[i-1])&&isdigit(s[i+1])) ||(isalpha(s[i-1])&&isalpha(s[i+1])))) { string sx=""; int sa,sb; sa=int(s[i-1]);sb=int(s[i+1]); for(int i=sa+1;i<sb;i++){ for(int j=0;j<p2;j++){ sx+=i; } } if(p1==2&&(isalpha(s[i-1])&&isalpha(s[i+1]))){ for(int i=0;i<sx.size();i++){ sx[i]=toupper(sx[i]); } } if(p3==2) reverse(sx.begin(),sx.end()); if(p1==3){ for(int i=0;i<sx.size();i++) sx[i]='*'; } for(int i=0;i<sx.size();i++) cout<<sx[i]; } else cout<<s[i]; } return 0; } ```
by hlb44 @ 2024-10-13 11:54:39


你写的太复杂了
by hlb44 @ 2024-10-13 11:55:32


@[luojiaheng44](/user/1027418) i套i了
by liumeihao @ 2024-10-17 15:06:30


三克油(但是还是80分pts……)
by luojiaheng44 @ 2024-10-20 11:42:42


|