import java.util.Scanner;

/**
 * 【程序38】
 * 
 * 题目:写一个函数,求一个字符串的长度,在main函数中输入字符串,并输出其长度。
 * 
 * @author James
 *
 */
public class 第三十八题统计字符串的长度 {
    public static void main(String[] args) {
        System.out.println("请输入一个字符串");
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        System.out.println("字符串的长度为:"+str.length());
        in.close();
    }
}

 

相关文章:

  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
  • 2021-08-29
  • 2022-01-20
相关资源
相似解决方案