Advertisement
Guest User

batmend1

a guest
Apr 29th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. string x , y, p;
  5.  
  6. int main(){
  7.  
  8. cin >> x >> y;
  9. int n = x.size();
  10.  
  11. for( int i = 0 ; i < n ; i ++ ){
  12. if( y[i] > x[i] ){
  13. cout << -1 ;
  14. return 0;
  15. }
  16. else{
  17. if( x[i] == y[i] ) p += 'z'; // end uurchlult hiisen shu. string-d char nemehed shuud += geed char-aa zaaj ugnu.
  18. else p += y[i]; // herev olon char esul string zalgaval aldaa zaana shu.
  19. }
  20. }
  21.  
  22. cout << p << endl; // string-g for bichih shaardlagagui shuud hevlej bolno.
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement