日志7
反转数
#include <iostream>
using namespace std;
int main()
{
long long a,b=0;
cin >> a;
while (a > 0) {
b = b * 10 + a % 10;
a = a / 10;
}
cout << b << endl;
return 0;
}
青蛙爬井
#include <iostream>
using namespace std;
int main()
{
int a, b, c, d;
cin >> a >> b >> c;//高,爬,掉
if (b >= a) {
cout << "1" << endl;
}
else {
d = (a - b) / (b - c);
if ((a - b) % (b - c) > 0) {
d++;
}
d += 1;
cout << d << endl;
}
return 0;
}