Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #define N 27
  4.  
  5. int main(){
  6. int massimo;
  7. char stringa[N];
  8. char pattern[3]={"xyz"};
  9. char max[10];
  10.  
  11. while(1){
  12. printf("\ninserisci dei valori: ");
  13. scanf("%s", stringa);
  14.  
  15. if(strlen(stringa)>massimo){
  16. massimo = strlen(stringa);
  17.  
  18. for(int i=0; i<massimo; i++){
  19. max[i] = stringa[i];
  20. }
  21. }
  22.  
  23. if(stringa[0]=='x' && stringa[1]=='y' && stringa[2]=='z')
  24. break;
  25. }
  26.  
  27. printf("il valore da stampare รจ %s", max);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement