Added more stupid coding files
This commit is contained in:
21
charcount.c
21
charcount.c
@@ -1,14 +1,17 @@
|
||||
#include <stdio.h>
|
||||
main (){
|
||||
int c, nb,nt,nl = 0;
|
||||
int c = 0;
|
||||
while ((c = getchar()) != EOF)
|
||||
{
|
||||
if(c='\0')
|
||||
++nb;
|
||||
if(c='\t')
|
||||
++nt;
|
||||
if(c='\n')
|
||||
++nl;
|
||||
if(c==' ')
|
||||
printf("blank ");
|
||||
if(c=='\t')
|
||||
printf("tab ");
|
||||
if(c=='\n')
|
||||
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