fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  5.  
  6. string s1, s2;
  7. cin >> s1 >> s2;
  8. if (s2.length() == s1.length() + 1) {
  9. int i , j;
  10. while (i < s1.length() && j < s2.length()) {
  11. if (s1[i] != s2[j]) {
  12. cout << "No\n";
  13. return 0;
  14. }
  15. }
  16. cout << "Yes\n";
  17. }
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
Standard output is empty