samedi 12 décembre 2020

i dont undrestand the differen between this two code

//this one print all the input in the same line 

main()

{    
int i=0,c;

    while  ((c=getchar())!=EOF) {

         if (c!=' '|| c!='\t' || c!='\n')

            putchar(c);

          else if (c==' '|| c=='\t' || c=='\n')
            printf("\n");
//this code work perfectly by i don undrestand the difference

 main{ 
         int  c;

         while  ((c=getchar())!=EOF) {

           if (c==' '|| c=='\t' || c=='\n')

               printf("\n");

           else if (c!=' '|| c!='\t' || c!='\n')

               putchar(c);
            }

}

Aucun commentaire:

Enregistrer un commentaire