Sono arrivato a questo...
Il problema però persiste.codice:#include <stdio.h> #define MAX 1000 //massima lunghezza di una stringa int cstring(char from[],char to[]); main() { char string[MAX]; char str[MAX]; int i,s; scanf(&string); while(string!=EOF) { int n=cstring(string,str); for(i=0;i<=n;++i) { if(str[i]!=' ' && str[i]!='\t') printf("%s",str[i]); else if(str[i]==' ' || str[i]=='\t') { s=i; while(i<=n) { ++i; if(str[i]!=' '&&str[i]!='\t') { printf("%s",str[s]); i=s++; break; } } } } } } // Trasferisce l'imput "from" nell'output "to" e ne calcola la lunghezza int cstring(char from[],char to[]) { int i; for (i=0;from!='\n';++i) from[i]=to[i]; return i; }

Rispondi quotando