Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define N 27
- int main(){
- int massimo;
- char stringa[N];
- char pattern[3]={"xyz"};
- char max[10];
- while(1){
- printf("\ninserisci dei valori: ");
- scanf("%s", stringa);
- if(strlen(stringa)>massimo){
- massimo = strlen(stringa);
- for(int i=0; i<massimo; i++){
- max[i] = stringa[i];
- }
- }
- if(stringa[0]=='x' && stringa[1]=='y' && stringa[2]=='z')
- break;
- }
- printf("il valore da stampare รจ %s", max);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement