三九宝宝网宝宝教育写作范文

1程序填空题:输入10个字符统计其中英文字母数字字符和其他

02月22日 编辑 39baobao.com

[Java键盘输入一个字符串分别统计出该字符串中所有数字大写英]参考代码如下: #include<stdio.h> int main() { char ch; int A,a,n,other; A=a=n=other=0; while((ch=getchar())!='\n'){ if(ch>='a'&ch<='z') ++a; else if(ch>='A'&ch<='...+阅读

你的程序 符号不对 用中文输入法时要用半角的不要用全角的符号 或者直接以英文形式输入

#include main( ) { char c; int letter=0,space=0,digit=0,other=0; printf("i请输入10个字符:\n"); while((c=getchar( ))!='\n') /*读取当前字符,如不为回车符则进行统计*/ { if(c>='a' c<='z'||c>='A'c<='Z') letter++; else if(c==' ') space++; else if(c>='0'c<='9') digit++; else other++; } printf(" letter=%d,space=%d,digit=%d,other=%d\n",letter,space,digit,other); }

以下为关联文档:

C语言输入一行字符分别统计出其中英文字母空格数字和其已改,看注释 #include<stdio.h> int main() { int a,b,c,d,f; char e[100]; a=b=c=f=0; printf("请输入一行字符\n"); gets(e); //改gets for(d=0;e[d]!='\0';d++) //改'\0' if(('...

输入一行字符统计该行字符包含英文字母空格数字和其他字符#include<stdio.h> void main() { int word,digital,other,space; word=digital=other=space=0; char string[20],*p; printf("Input:"); gets(string);// //*string=0; p=str...

c输入一行字符分别统计出英文字母空格数字和其他字符的个数 // 错误1: 标准C++除了兼容, 一般是不是用字符数组的, 而是用string // 错误2: cin >> a 这种方式并不能读入空格 // 错误3:a[j]<='z'&&a[j]>='a'||a[j]<='Z'&&a[j]>='A'这样...

输入一行字符分别统计出其中英文字母空格数字和其它字符的字#include <stdio.h> void main() { int letter=0,space=0,digit=0,other=0; char c; while((c=getchar())!='\n') { if('a'<=c && c<='z' || 'A'<=c && c<='Z') letter++; e...

输入一行字符分别统计其中的英文大写字母小写字母数字字符#include<stdio.h> main() { int i = 0,di=0,ll=0,ul=0,el=0; char a[100]; printf("please input string:\n"); gets(a); while(a[i]) { if(a[i]>='a' & a[i]<='z') ll++; el...

1输入一行字符分别统计出其中英文字母空格数字和其他字符#include <stdio.h> int main(int argc, char *argv[]) { int i[4]={0,0,0,0}; char a; while((a=getchar())!='\n') { if(a>='0'&a<='9') i[0]++;//数字 else if((a>='a'&a<...

C程序:输入若干字符分别统计数字字符的个数英文字母的个数#include "stdio.h" void main() { char s; int i=0,j=0,k=0,m=0,da=0,xiao=0; printf("please input the string\n"); while((s=getchar())!='\n') /*循环从键盘读入字符直到一...

汇编程序分类统计字符串中大小写字母数字其他字符个数;分类统计字符串中大小写字母,数字,其他字符个数 ;定义字符串,不需要键盘输入,统计结果依次保存到X1,X2,X3,X4中 data segment buf db 'asdg123456,^&%$#$' X1 db 0 X2 db 0 X3 db...

汇编从键盘输入一串字符分别统计其中字母数字和其他字符没代码怎么看。。。 附上我的:(没调) program easy; var st:string; a:array [1..3] of longint; i:longint; begin readln(st); fillchar(a,sizeof(a),0); for i:=1 to length...

推荐阅读
图文推荐