这啥呀这是

P1307 [NOIP2011 普及组] 数字反转

你想表达什么?
by gtafics @ 2023-08-09 20:20:37


输出的东西令我难以理解、一言难尽……
by shooting__star @ 2023-08-09 20:22:06


请问你AC了吗
by 123456789dd @ 2023-08-09 20:23:00


@[123456789dd](/user/1043825) 连样例都过不了
by shooting__star @ 2023-08-09 20:37:01


而且上来就RE
by shooting__star @ 2023-08-09 20:37:52


@[liyirong567](/user/955954) 加减法分不清?
by 聊机 @ 2023-08-09 20:38:37


刚刚自己改了以后更离谱了 ```cpp #include<bits/stdc++.h> using namespace std; int main() { string a; bool first=false; cin>>a; int l=a.length(); for(int i=l-1;i>-1;i++) { if(a[i]==0) { if(first==true) { cout<<a[i]; } } else if(a[i]!='-') { first=true; cout<<(int)(a[i]-48); } } return 0; } ```
by shooting__star @ 2023-08-09 20:40:43


```cpp #include<bits/stdc++.h> using namespace std; int main() { string a; bool first=false; cin>>a; int l=a.length(); for(int i=l-1;i>-1;i++) { if(a[i]=='0') { if(first==true) { cout<<a[i]; } } else if(a[i]!='-') { first=true; cout<<(char)a[i]; } } return 0; } ``` RE*3
by shooting__star @ 2023-08-09 20:43:58


这不行了吗 思路清晰,代码简洁,~~极致压行。~~ ``` #include<bits/stdc++.h> using namespace std; int main() { int n=0,s=0; cin>>n; while(n){ s=s*10+n%10; n/=10;} cout<<s; return 0; } ```
by 123456789dd @ 2023-08-09 20:44:38


``` #include<bits/stdc++.h> using namespace std;int main(){int n=0,s=0;cin>>n;while(n){ s=s*10+n%10; n/=10;}cout<<s;return 0;} ``` 2行的代码,拿去抄吧
by 123456789dd @ 2023-08-09 20:46:56


| 下一页