Codeforces801B Valued Keys

来源:互联网 发布:淘宝首页全屏海报尺寸 编辑:程序博客网 时间:2024/06/06 00:54

链接

  http://codeforces.com/problemset/problem/801/B

题解

  判下是不是1如果不是1就直接输出z串。

代码

//手速题#include <cstdio>#include <algorithm>#include <cstring>#define maxn 105using namespace std;char x[maxn], z[maxn], y[maxn];int N;int main(){    int i;    scanf("%s%s",x+1,z+1); N=strlen(x+1);    for(i=1;i<=N;i++)        if(z[i]>x[i])        {            printf("-1");            return 0;        }    printf("%s",z+1);    return 0;}
0 0
原创粉丝点击