小唐唐 • 7天前
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;
}
评论:
请先登录,才能进行评论