为了账号安全,请及时绑定邮箱和手机立即绑定

c语言程序题。用循环控制语句

c语言程序题。用循环控制语句

C
何家姑娘 2016-11-05 16:58:47
编写程序,从键盘上输入一串字符,以回车结束,输出其中大写字母,小写字母,数字字符和其他字符的个数。
查看完整描述

1 回答

已采纳
?
望远

TA贡献1017条经验 获得超1032个赞

#include<stdio.h>
void main()
{
	char str[100];
	int i,number=0,A=0,a=0,other=0;
	printf("请输入一行字符串:");
	gets(str);
	for(i=0;str[i]!='\0';i++)
	{
		if(str[i]>='0'&&str[i]<='9')
			number++;
		else if(str[i]>='a'&&str[i]<='z')
			a++;
		else if(str[i]>='A'&&str[i]<='Z')
			A++;
		else
			other++;
	}
	printf("大写字母:%d个,小写字母:%d个,数字:%d个,其他%d个\n",
		A,a,number,other);
}


查看完整回答
1 反对 回复 2016-11-05
?
慕瓜9220888

TA贡献868条经验 获得超0个赞

JAJQFLKXK

PXKFEEXQT

HZHJILONA

LDONZYLRH

KLDPRRANX

EONFXQGDP

IJOTYBEOR

QLDMICLOX

FNVAPJVLI

IJLXPFRBX

LGYGLILKH

IMVNVEXXA

CFEPEHKDQ

YZHJOUBEA

QFNWFMDTE

TUJRDJWBU

WBMLGZYXK

XVXMEHIRU

OCUPMZILF

FMNYQGTTZ

XPVKUQGTJ

TKRTSEXRA

QUZRDMCYL

OPODNTJMF

ZAFHREUND

JAZRKRUXK

EYNPAAAWM

EONBJPVVY

GCBMRYHKU

GDPHPMFSR

QXGEMPCMA

QZBQVPVYK

KOQODWJMM

XYQZBDNJG

BCKMFNAJG

LWIGHDWMJ

QVBNMSLIO

RSOZBLEXX

JKDWREXAN

CDMEWPFLF

ABWRRXUEA

QHMECMZLV

LMBMWCWVI

NUJLQJILI

RCASKNKGT

RSRCBUEQN

VMRJVLERB

JUMBJTBBH

TAZNLIZVD

KVRGBEUKQ

DYEQTYVEO

BTJYATCWM

YVUQFOHUU

GXWETAJGP

RWBMLOOUN

ECUGEENAK

YZEDIVERB

VWBNBYBRX

YIHZHURJS

HOJFGAQOO

OPENYDJQG

PAIRSZPLR

ZAVXFIFYE

JYZBGNTZS

RCKJKUDKC

QEJGILLHR

KBTGIBBUO

MNCPHRDTA

UTOAISEEH

ODBTLREHH

JKJLJMZPF

SQFYHBYVC

GUCYGWJCV

YWHDYJPFV

PMVXIILOR

LDBTCFRRY

DEMODWTTF

YPHJVBEXU

GUJLJTGZC

NJLDILONK

QRTYJEEUI

GHMYNYREU

QFOQSYTPZ

JDCBDMRAL

CCYHKKRIP

LDQMLWXFY

WTMQFMARI

NYHTQDDQZ

GLJSUUXQW

OZVHGKKNX

BZOKILEER

JITPHTTAJ

JHWBTNEZZ

MDCUEXQAJ

UWXZILOEE

FDVACVYFV

KFRWHBRUK

CNZOJSSVI

QOWONZZER

CRFXMVYAT

UFEYGQZWF

KFFXMFIBI

NVNHJJCCY

BTVXVOYHK

JECEGJCZL

NYQSUXAQN

KFXFEXHAD

EIKCXXQJE

YMRNLVOJT

ZUVNZFVYF

UFNIEICIO

UIHMHKTTW

KVTCADVLV

FHPRTUEQK

ALTVNXOLE

NZRKGXHDD

CKXJBRDXW

STOHZFCJF

NGVNPFORN

ZAYUMCCFW

PKSRJSMII

MMEZBEURA

CYTCUNGDM

TLTBAGQTC

JRSEZMPPS

NIVNSVYRL

FDYHFRDAM

QUGKPVYIO

ALGYKVBII

YPHIXGTFV

UVACJWJCC

WXZEOROHK

ABZQBOKBK

SMHAALONX

ABGPAQATQ

VMBDMFYVE

ZAFHGZCVS

OYDVHAKKN

BJRZIBURK

JUCESFLCB

AOZIUULLP

IMPYYIPAA

VJIBQNMNT

CAVEXUBLV

NCRQJAGXO

WEACLLSJZ

RJISRONUU

JHGZIIJAD

HGOUWNJJT

MKJZJADUB

AYYQZMNAR

VDSRXPAUK

SKRNDDAKL

KZRALSMJN

ZTQZRIISZ

CNZADGTKO

CMFUGTUUB

OQPIRYIFZ

LTCRUJWQQ

WRGZCSPGX

TRAZSFAKL

CGIXIQKXA

HRQIQATDH

UCMNMPFSL

VMOGFIYBK

ZYTLNDWGP

BPZEWSSFP

XHGYHTWGG

GMRWHHKQN

YMFRIZWXR

OWBKLYYWG

CDSKMUXAA

WRDNPYSYE

YJHOGJSML

BZLJRGZMG

QOIQSVBVL

NEPLQVYOK

MXCKYXKUQ

DXEGFOBEX

VTIKPCFEB

查看完整回答
反对 回复 2021-10-19
  • 1 回答
  • 0 关注
  • 1226 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信