current position:Home>Count in the string and find the English characters

Count in the string and find the English characters

2022-02-03 02:13:53 CSDN Q & A

Count into a string , Find the number of all English characters ( Custom function )




Refer to the answer 1:
#include <stdio.h>int fun(char str[]){int i,n=0;for(i=0;str[i];i++)if(str[i]>='a'&&str[i]<='z'||str[i]>='A'&&str[i]<='Z')n++;return n;}void main(){char k[60];gets(k);printf("%d\n", fun(k));}



Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030213519489.html

Random recommended