解题思路:
注意事项:
参考代码:
#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语言程序设计教程(第三版)课后习题1.6 (C++代码)浏览:905 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:677 |
C语言程序设计教程(第三版)课后习题6.5 (C++代码)浏览:471 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:872 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:1458 |
C语言程序设计教程(第三版)课后习题1.6 (C语言代码)浏览:562 |
大家好,我是验题君浏览:580 |
sizeof的大作用 (C语言代码)浏览:1073 |
Tom数 (C语言代码)浏览:562 |
GC的苦恼 (C语言代码)浏览:635 |