new file: proglabs/lab6/1.c
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int ch,sp,n,s;
|
||||
sp = n = s = 0;
|
||||
while((ch = getchar())!='#'){
|
||||
switch(ch){
|
||||
case ' ': n++; break;
|
||||
case '\n': sp++; break;
|
||||
default: s++; break;
|
||||
}}
|
||||
printf("spaces: %d\tnewln: %d\tsymb: %d\n",sp,n,s);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user