求问?如果用这种方法,哪里错了

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

chengwenhao @ 2023-11-15 11:13:31



#include<stdio.h>

using namespace std;

int main()

{

      float a,h,s;

      int b,c,d,x;

      cin>>a;

      a=x;

      b=a/100;

      c=x%100/10;

      d=x%100%10;

      h=a-(b+c+d);

      s=h*10+d*0.1+c*0.01+b*0.001;

      cout<<s<<endl;

return 0;

}

by MA202311 @ 2023-11-24 22:56:22

a=x; 是不是写反了


by lhz21111 @ 2024-01-06 18:34:06

试试字符串


by ds2321lyj @ 2024-01-20 10:32:26

可能是符点


by Hi_Marcus @ 2024-04-07 22:10:23

你的编译有问题,得用iostream头


|