Added more stupid coding files

This commit is contained in:
2020-12-07 09:12:18 +02:00
parent 463eceae52
commit 4811964a71
5 changed files with 12 additions and 9 deletions

BIN
charcount

Binary file not shown.

View File

@@ -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
getchar

Binary file not shown.

BIN
hello

Binary file not shown.

Binary file not shown.