horizontal include stdio define IN define OUT int main int wlength sta

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
*
* horizontal
*
*/
#include <stdio.h>
#define IN 1
#define OUT 0
int main()
{
int c, i, wlength=0, state=OUT;
while((c=getchar())!=EOF)
{
if(c!=' ' && c!='\n' && c!='\t')
{
if((c>=65 && c<=90) || (c>=97 && c<=122))
{
++wlength;
state=IN;
}
}
else if(state==IN)
{
for(i=0;i<wlength;i++)
{
putchar('*');
}
putchar('\n');
wlength=0;
state=OUT;
}
}
return 0;
}