在c语言中,输入几个数字,怎样输出其中出现最多的数字,并且输出数字出现...答:include<stdio.h>int main(){ int n=10; int a[10]={1,2,3,4,4,4,5,5,5,5}; int b[10],len=0,count[10]; int i,j,max=0; for(i=0;i<n;i++){ for(j=0;j<len;j++){ if(a[i]==b[j]){ count[j]++; break; } } if(...
c语言 随机输入一个字符串,统计该串中每个数字字符(0,1,2,3,4,5,6...答:include<stdio.h> include<string.h> void main(){ char s[100];int i;static int num[10];scanf("%s",s);for(i=0;i<strlen(s);i++)if(s[i]>='0'&&s[i]<='9')num[s[i]-'0']++;for(i=0;i<=9;i++)printf("%d出现的次数为:%d\n",i,num[i]);} ...
C语言,输入一段字符串,分别统计其中大写,小写,数字,字符的个数,并输出...答:include "stdio.h"#include "conio.h" int main(){ char s[100],*p=s; int num,upper,lower,other; num=upper=lower=other=0; printf("Please enter a string:"); gets(s); for(;*p!='\0';p++) { if(*p>='0' && *p<='9') num++; else if(*p...