I haven't written a program for a long time, exercises 5.2. For, getchar, etc.

xiaoxiao2021-03-05  28

#include main () {char C; int N, letter = 0, space = 0, Num = 0, other = 0; for (n = 0; (c = getchar ())! = '/ N '; N ) {Printf ("% C", c); if (c> =' a '&& c <=' z || c> = 'a' && c <= 'z') letter ; if (c > = '0' && c <= '9') num ; if (c == '') space ;} other = n-letter-num-space; printf ( "n =% d letter =% d num =% d Space =% D other =% D ", N, Letter, Num, Space, Other); getCh ();

Statardize the characters you enter, how many, letters, numbers, others are all.

It is found that you have a big problem on letters.

I want to work hard.

转载请注明原文地址:https://www.9cbs.com/read-33308.html

New Post(0)