为什么我输入123.4输出的是0.321?不应该是4.321吗?!!求求各位大佬了,救救孩子吧!!!
#include<iostream> using namespace std; int main() { double a,f; int b,c,d,e; cin>>a; b=a/100; c=a/10-10*b; d=a/1-100*b-10*c; e=a-100*b-10*c-1*d; f=e+0.1*d+0.01*c+0.001*b; cout<<f; return 0; }