AquaBlitz11

[t106] Pizza

Oct 9th, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int check_pizza(char S[], char T[])
  5. {
  6.     int n = strlen(S);
  7.     int m = strlen(T);
  8.     int j = 0;
  9.     for (int i = 0; i < n; ++i) {
  10.         if (S[i] == T[j])
  11.             ++j;
  12.     }
  13.     return j == m ? 1 : 0;
  14. }
Add Comment
Please, Sign In to add comment