Something
public text v1 · immutable#include <stdio.h>
/* Print histogram of number of chars for each word virtically...*/
int main (void)
{
int c, i = 0, numbchars =0;
int oldword [256] = {0} ; /* Only 256 lettres max so probably easy to break...*/
/* Set all 256 indexes of the array "oldword" to 0*/
while ((c = getchar ()) !=EOF)
{
if ( c == ' ' || c == '\n' || c == '\t')
{
for ( i =0; i <= numbchars; i++)
putchar (oldword [i]);
printf ("%d\n", numbchars);
}
else
{
++numbchars;
oldword [i] =c;
}
}
return 0;
}