答案

小唐唐 · 发布于 2026-01-30 · 浏览 223 回复 0

include

include

include

using namespace std;

void run(void){

int a = 0;
double b = 100.0, c = 0.0, sun = 0.0;
cin >> a;
if (a == 0) {
    b = 0.0;
    sun = 100.0;
} else {
    c = 100.0; 
    for (int i = 2; i <= a; i++) {
        c /= 2; 
        b += 2 * c; 
    }
    sun = c / 2;
}
printf("%.6f %.6f\n", b, sun);
return;

}

int main(){

run();
return 0;

}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复