Codeforces 801B Valued Keys

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Dragon_fxl/article/details/70208647

原题传送


这题挺水的,直接上代码吧

#include <bits/stdc++.h>
using namespace std;
int main() {
    char a[105], b[105];
    int i = 0;
    scanf("%s%s", a, b);
    for(i = 0; i < strlen(a); i++)
        if(a[i] < b[i])
            break;
    printf("%s\n", i < strlen(a) ? "-1" : b);
    return 0;
}


猜你喜欢

转载自blog.csdn.net/Dragon_fxl/article/details/70208647