一、参考解法: s =input('请输入字符串:') dic={'letter':0,'integer':0,'space':0,'other':0} for i in s: if i >'a' and i<'z' or i>'A' and i<'Z ...
一 参考解法: s input 请输入字符串: dic letter : , integer : , space : , other : for i in s: if i gt a and i lt z or i gt A and i lt Z : dic letter elif i in : dic integer elif i : dic space else : dic other prin ...
2019-07-08 14:02 0 596 推荐指数:
一、参考解法: s =input('请输入字符串:') dic={'letter':0,'integer':0,'space':0,'other':0} for i in s: if i >'a' and i<'z' or i>'A' and i<'Z ...
列表,依次输出原列表,以及列表中的最高分、最低分并按成绩从高分到低分排列降序输出列表各元素。 输入一 ...
//alphabet 英文字母 ,blank 空格,数字 digit#include <stdio.h>int main(){ char c; int alphabet=0,blank=0,digit=0,other=0; printf("请输入一行字符:\n ...
public class CaculateCharCount { /** * @description 输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数。 * @param args */ public static void main(String ...
public static void main(String[] args) { //输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数。 String str="ABab哈哈 123,"; int letter=0;//字母 int space=0;//空格 int number ...
题目:输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数。 程序分析:利用while语句,条件为输入的字符不为 '\n '. ...
Scanner.useDelimiter( )方法 由于Scanner对象将首先跳过输入流开头的所有空白分隔符,然后对输入流中的信息进行检查,直到遇到空白分隔符为止;因此输入数据:this is a test;空白后面的字符:is a test不会显示输出来 这时就需要 ...