解题思路:
注意事项:
参考代码:
#include<iostream>
using namespace std;
int main()
{
int h = 1189;
int t = h;
int w = 841;
string s;
cin >> s;
int size = s[1] - 48;
size = size + 1;
if (size == 1)
{
cout << h << endl;
cout << w << endl;
return 0;
}
for (int i = 2; i <= size; i++)
{
h = w;
w = t / 2;
t = h;
}
cout << h << endl;
cout << w << endl;
}
0.0分
0 人评分