| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:那位大哥哥,大姐姐 能帮我看看为什么WRONG ANSWERIn Reply To:那位大哥哥,大姐姐 能帮我看看为什么WRONG ANSWER Posted by:ban at 2006-07-05 16:29:03 咋两想一块去了 一样WA
#include <iostream>
#include <cstring>
using namespace std;
char a[1000];
char temp;
int i,n,j;
int main ()
{
while(cin>>a&&a[0]!='#')
{
n=strlen(a)-1;
temp=a[n];
for(i=n-1;a[n]<=a[i]&&i>0;i--)
;
if(i==0)
cout<<"No Successor";
else
{
for(j=n-1;j>=i;j--)
a[j+1]=a[j];
a[i]=temp;
for(i=0;i<=n;i++)
cout<<a[i];
}
cout<<endl;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator