import java.util.*; public class Demo { public static void main(String[] args){ int days = 0; Scanner sc = new Scanner(System.in); System.out.print("输入年份: "); int year = sc.nextInt(); System.out.print("输入月份: "); int month = sc.nextInt(
B站有视频演示 本章学习printf函数的输入输出,字符串的定义与实用. 字符串 字符串(character string)是一个或多个字符的序列,如下所示: "Zing went the strings of my heart!" 双引号不是字符串的一部分.双引号仅告知编译器它括起来的是字符 串,正如单引号用于标识单个字符一样. 字符串的存储 用数组(array)储存字符串(character string).在该程序中,用户输 入的名被储存在数组中,该数组占用内存中40个连续的字节