Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int i, j, found=1;
  6. char *strings[] = {
  7. "je suis une phrase.",
  8. "moi aussi.",
  9. "lolo la street",
  10. "j'aime la confiture de fraises",
  11. "l'info c'est cool",
  12. "trump president des usa",
  13. "macron president francais",
  14. "votre code confidentiel",
  15. "pour les jeunes",
  16. "course a pied"
  17. };
  18. char temp[60];
  19. printf("Entrez une phrase : \n");
  20. gets(temp);
  21. for (i=0;i<10;i++){
  22. j=0;
  23. while (temp[j]!='\0'){
  24.  
  25. if (strings[i][j]!=temp[j])
  26. found=0;
  27. j++;
  28. }
  29. if (found)
  30. printf("phrase trouvee ligne %d",i+1);
  31. found=1;
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement