疑似《AI》代码
2024-12-15 18:03:18
发布于:浙江
126阅读
0回复
0点赞
#include <bits/stdc++.h>
#define int long long
using namespace std;
void solve() {
string s;
cin >> s;
int n = s.size();
if (n == 1) {
cout << s;
return ;
}
for (int i = 0; i < n - 1; i++)cout << 9;
if (s.substr(0, n - 1) == string(n - 1, '9'))cout << s[n - 1];
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T = 1;
//cin >> T;
while (T--) {
solve();
}
return 0;
}
全部评论 1
2024-11-13 来自 浙江
0
有帮助,赞一个