This commit is contained in:
NaiJi ✨ 2024-04-18 03:07:42 +04:00
parent cc830059f0
commit 5c799b0389
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#include <stdio.h>
main()
{
int c;
int count_tabs = 0;
int count_newlines = 0;
int count_spaces = 0;
while ((c = getchar()) != EOF)
{
if (c == '\t')
++count_tabs;
if (c == '\n') {
++count_newlines;
printf("\n\ntabs: %d, spaces: %d, newlines: %d\n", count_tabs, count_spaces, count_newlines);
}
if (c == ' ')
++count_spaces;
}
printf("\n\ntabs: %d, spaces: %d, newlines: %d\n", count_tabs, count_spaces, count_newlines);
}