为什么只有20分,求助各位大佬

P1307 [NOIP2011 普及组] 数字反转

钱轩宇 @ 2019-08-07 16:25:47

include <bits/stdc++.h>

using namespace std; int main() { int n,a,b,c,ans; scanf("%d",&n); a=n/100; b=n/10%10; c=n%10; ans=100c+10b+a; printf("%d",ans); return 0;

}


by xyf007 @ 2019-08-07 16:29:19

希望更丰富的展现?使用Markdown


by 亦·心 @ 2019-08-07 16:29:59

希望更丰富的展现?使用Markdown


by    吾皇 @ 2019-08-07 16:30:11

首先它不一定是三位数...能不要用#强调头文件的重要性吗


by 李若谷 @ 2019-08-07 16:33:36

不一定是三位数


by xyf007 @ 2019-08-07 16:35:38


by wuhan717 @ 2019-08-18 20:39:28

include <iostream>

using namespace std; int main () { int t=0,m,a; cin>>m; while(m!=0) { a=m%10; t=t*10+a; m=m/10; } cout<<t<<endl; }


by 飞友737ng @ 2019-08-27 14:19:01

include<bits/stdc++.h>

using namespace std; int main() { int a,b; cin>>a>>b; while(a!=0){ b=b*10; b=b+a%10; a=a/10; } cout<<b<<endl; }


by ldto @ 2019-10-11 13:14:59

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.


|