Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
oorrja
GitHub Repository: oorrja/learntosolveit
Path: blob/master/languages/cprogs/Ex_1.13_His_Horizontal.c
1240 views
1
/**
2
*
3
* Print a horizontal histogram of words in the input.
4
*
5
**/
6
7
#include <stdio.h>
8
9
int main(void)
10
{
11
int c;
12
13
while((c=getchar()) != EOF)
14
{
15
if( c == ' ' || c == '\n' || c == '\t')
16
putchar('\n');
17
else
18
putchar('*');
19
}
20
return 0;
21
}
22
23