Added more stupid coding files
This commit is contained in:
21
charcount.c
21
charcount.c
@@ -1,14 +1,17 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
main (){
|
main (){
|
||||||
int c, nb,nt,nl = 0;
|
int c = 0;
|
||||||
while ((c = getchar()) != EOF)
|
while ((c = getchar()) != EOF)
|
||||||
{
|
{
|
||||||
if(c='\0')
|
if(c==' ')
|
||||||
++nb;
|
printf("blank ");
|
||||||
if(c='\t')
|
if(c=='\t')
|
||||||
++nt;
|
printf("tab ");
|
||||||
if(c='\n')
|
if(c=='\n')
|
||||||
++nl;
|
printf("newline\n");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("%d",c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
printf("\nThere are %d blanks, %d tabs, and %d new lines\n", nb,nt,nl);
|
}
|
||||||
}
|
|
||||||
BIN
temperature
BIN
temperature
Binary file not shown.
Reference in New Issue
Block a user