解题思路:
注意事项:
参考代码:
#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语言代码)浏览:560 |
C语言程序设计教程(第三版)课后习题10.7 (C语言代码)浏览:982 |
蛇行矩阵 (C语言代码)浏览:767 |
A+B for Input-Output Practice (II) (C语言代码)浏览:1009 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:578 |
淘淘的名单 (C语言代码)浏览:1120 |
1157题解浏览:738 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:577 |
C语言程序设计教程(第三版)课后习题9.4 (C语言代码)浏览:664 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:325 |