Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- string x , y, p;
- int main(){
- cin >> x >> y;
- int n = x.size();
- for( int i = 0 ; i < n ; i ++ ){
- if( y[i] > x[i] ){
- cout << -1 ;
- return 0;
- }
- else{
- if( x[i] == y[i] ) p += 'z'; // end uurchlult hiisen shu. string-d char nemehed shuud += geed char-aa zaaj ugnu.
- else p += y[i]; // herev olon char esul string zalgaval aldaa zaana shu.
- }
- }
- cout << p << endl; // string-g for bichih shaardlagagui shuud hevlej bolno.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement