Advertisement
nguyentien281006

PREFIX

Aug 9th, 2022
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5.     ios::sync_with_stdio(false);
  6.     cin.tie(nullptr);
  7.     string a, b;
  8.     getline(cin , a);
  9.     getline(cin , b);
  10.     if(!b.compare(0, a.size() ,a)) cout << "Yes\n";
  11.     else cout << "No\n";
  12.     return 0;
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement