Advertisement
sivan_iut

Untitled

Apr 8th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. ///HELLO THERE~!
  2. ///CREATED BY MD SADMAN MEHEDI SIVAN(IUT CSE-SWE^19)
  3.  
  4. #include <bits/stdc++.h>
  5.  
  6. #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  7. #define read freopen("blue.txt","r",stdin);
  8. #define write freopen("red.txt","w",stdout);
  9. #define pie 2*acos(0.0);
  10.  
  11. typedef long long ll;
  12.  
  13. using namespace std;
  14.  
  15.  
  16. int main()
  17. {
  18.    
  19.     int T;
  20.     scanf("%d",&T);
  21.    
  22.     for(int i=0; i<T; i++)
  23.     {
  24.         printf("Case %d: ",i+1);
  25.        
  26.         string sivan;
  27.         cin>>sivan;
  28.        
  29.         string bakon ;
  30.         cin>>bakon ;
  31.        
  32.         int count=0;
  33.        
  34.         for(int i=0; i<sivan.size(); i++)
  35.         {
  36.             string pizza=sivan.substr(i,bakon .size());
  37.             if(pizza==bakon )
  38.             {
  39.                 count++;
  40.  
  41.             }
  42.         }
  43.        
  44.         printf("%d\n",count);
  45.  
  46.     }
  47.  
  48.  
  49.  
  50.     return 0;
  51.  
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement