解题思路:
注意事项:
参考代码:
#include <iostream> #include <iomanip> using namespace std; int main() { int m = 0, n = 0; double c = 0, d = 0; cin >> m >> n; c = m, d = m; for (int i = 0; i < n; i++) { d += c; c /= 2; } d -= 2 * c; cout << fixed << setprecision(2) << c << ' ' << d; return 0; }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:453 |
分糖果 (C++代码)浏览:1467 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:527 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:1059 |
wu-淘淘的名单 (C++代码)浏览:1395 |
最小公倍数 (C语言代码)浏览:1047 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:594 |
【计算球体积】 (C语言代码)浏览:1579 |
幸运数 (C++代码)浏览:2902 |
众数问题 (C语言代码)浏览:636 |