#include\x20\x20\x20\x20\x20#include\x20\x20//\x20用于设置输出精度\x20\x20\x20\x20using\x20namespace\x20std;\x20\x20\x20\x20int\x20main()\x20{\x20\x20\x20\x20\x20\x20int\x20a,\x20k;\x20\x20\x20\x20\x20\x20cin\x20>>\x20a\x20>>\x20k;\x20\x20\x20\x20\x20\x20//\x20计算10的k次方\x20\x20\x20\x20\x20\x20double\x20power\x20=\x201;\x20\x20\x20\x20\x20\x20for\x20(int\x20i\x20=\x200;i\x20<\x20k;i++)\x20{\x20\x20\x20\x20\x20\x20\x20\x20power\x20*=\x2010;\x20\x20\x20\x20\x20\x20}\x20\x20\x20\x20\x20\x20//\x20还原成一般写法\x20\x20\x20\x20\x20\x20double\x20result\x20=\x20a\x20*\x20power;\x20\x20\x20\x20\x20\x20//\x20输出结果\x20\x20\x20\x20\x20\x20cout\x20<<\x20fixed\x20<<\x20setprecision(0)\x20<<\x20result\x20<<\x20endl;\x20\x20\x20\x20\x20\x20return\x200;\x20\x20\x20\x20}

C++ 科学计数法还原为一般写法:代码实现及精度说明

原文地址: https://www.cveoy.top/t/topic/p5qe 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录