你们の黄鳝 @ 2019-09-07 08:26:49
#include <iostream>
#include <string>
using namespace std;
int sn[100000000];
int main(){
string s;
int i,j,k;
cin>>s;
j=0;
for(i=0;i<s.length();i++)sn[i]=s[i]-48;
for(i=0;i<s.length();i++){
if(sn[i]<0){
sn[i]=0;
j++;
}
}
if(j>0)cout<<"-";
for(i=s.length()-1;i>=0;i--){
if(sn[i]!=0)cout<<sn[i];
}
}
爲什麽衹有70分啊……感覺沒有什麽問題,自己也檢查不出……求求大佬救救孩子QAQ
by Nicoppa @ 2019-09-07 08:43:25
...您后面的0也清掉了,加个判断
by GAVI824 @ 2019-09-07 08:43:38
return 0; 没写?
by wyw666 @ 2019-09-07 08:48:54
if(sn[i]!=0)cout<<sn[i];
这行炸了
%%%同机房
by 我不认识你 @ 2019-09-07 08:49:00
@black_panther 写不写对最终输出应该没有影响
by GAVI824 @ 2019-09-07 08:59:41
呃呃呃
by 你们の黄鳝 @ 2019-09-07 09:07:39
#include <iostream>
#include <string>
using namespace std;
int sn[1000000];
int main(){
string s;
int i,j,k;
cin>>s;
j=0;
for(i=0;i<s.length();i++)sn[i]=s[i]-48;
for(i=0;i<s.length();i++){
if(sn[i]<0){
sn[i]=0;
j++;
}
}
k=0;
if(j>0)cout<<"-";
for(i=s.length()-1;i>=0;i--){
if(sn[i]!=0){
cout<<sn[i];
k++;
}
else{
if(k>0)cout<<sn[i];
}
}
if(s=="0")cout<<"0";
return 0;
}
我是什麽品種的辣雞……改了一遍代碼后衹有50分了……
by dfh123456 @ 2019-09-07 09:27:00
大佬大佬 流弊
by ldto @ 2019-10-11 13:14:24
var s:ansistring; bz:boolean; i:longint; begin readln(s); if s[1]='-' then write('-'); bz:=false; for i:=length(s) downto 1 do begin if s[i]<>'0' then bz:=true; if(bz)and(s[i]<>'-')then write(s[i]); end; end.
by GAVI824 @ 2019-10-26 08:56:12
流弊