nikolas_serafini

Lista 4 - Exercício 34

Jun 25th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6.     int i;
  7.     char text[200];
  8.  
  9.     printf("Entre com um texto :\n");
  10.     gets(text);
  11.     for (i = 0; i < strlen(text); i++)
  12.     {
  13.         if ((text[i] == 'w' && text[i+1] == 'e' && text[i+2] == 'b') && (text[i+3] == ' ' || text[i-1] == ' '))
  14.         {
  15.             printf("Texto possui a palavra 'web'!\n");
  16.             return 0;
  17.         }
  18.     }
  19.     printf("Texto nao possui a palavra 'web'!\n");
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment