#include<iostream> #include<math.h> using namespace std; int main(){ float a; float b = 0; cin>>a; for(int i=4; i>0; i--){ float temp = pow(10,i-2); b += (a/temp)*pow(10,-i+1); a = a - (a/temp)*temp; } cout<<b; return 0; }
感谢各位大佬帮助TAT