Advertisement
Riposati

Untitled

Jul 19th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <algorithm>
  5. #include <cstdio>
  6.  
  7. using namespace std;
  8.  
  9. int main ()
  10. {
  11.   string str,str2;
  12.   long long caseTes=1;
  13.  
  14.   while(cin>>str){
  15.  
  16.     if(str=="0")break;
  17.     cin>>str2;
  18.  
  19.     size_t found = str2.find(str);
  20.  
  21.     printf("Instancia %llu\n",caseTes++);
  22.  
  23.     if (found!=string::npos){
  24.         printf("verdadeira\n");
  25.     }else{
  26.         printf("falsa\n");
  27.     }
  28.  
  29.     printf("\n");
  30.   }
  31.  
  32.   return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement