大佬给看看这个怎么回事,80分

P5705 【深基2.例7】数字反转

dzt2008 @ 2024-09-10 18:58:09

#include<bits/stdc++.h>
using namespace std;
int main(){
    float m;
    cin>>m;
    int a=m/100;
    int b=(m-a*100)/10;
    int c=m-a*100-b*10;
    int d=((m*10)-a*1000-b*100-c*10);
    cout<<d+c*0.1+b*0.01+a*0.001<<endl;
    return 0;
}

by Just_a_oler @ 2024-09-10 19:14:20

WA哪了


by shanxiwen @ 2024-09-10 19:15:08

玄学,数据下下来是一样的 @dzt2008


by dzt2008 @ 2024-09-11 17:34:15

@Just_a_oler wrong WA上给的这个 Answer.wrong answer On line 1 column 1, read 7, expected 8.


by dzt2008 @ 2024-09-11 17:37:35

@shanxiwen 是的QWQ


by fengpengyu2030 @ 2024-09-13 22:32:50

@dzt2008 可以不把它当数 ``cpp

include<bits/stdc++.h>

using namespace std;

char a[11]; int main(){

ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
for(int i=1;i<=5;i++){
    cin>>a[i];
}
for(int i=5;i>=1;i--){
    cout<<a[i];
}

return 0;

}


by fengpengyu2030 @ 2024-09-13 22:34:32

@fengpengyu2030 回复搞错了代码前面还有一部分


|