题解 | 不要三句号的歪

不要三句号的歪

https://www.nowcoder.com/practice/7cbb7d96fb354f7995d9af1ccf8906b4

#include <iostream>
using namespace std;

int main() {
    int a;
    cin >> a;
    string str;
    getline(cin, str);
    int i = str.size() - 1;
    string c = "";
    while(isdigit(str[i])) c = str[i--] + c;
    
    cout << stol(c) - a - 2 << endl;

    return 0;

}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务