求编程大佬 谢谢
展开全部
//2. 分钟换算
int h = 560/60;
int m = 560-60*h;
System.out.println(h+"小时"+m+"分钟");
//3. 个位,十位,百位求和
System.out.println("请输入一个三位数:");
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int sum = num%10+num%100/10+num/100;
System.out.println("和是:"+sum);
//4. 交换变量
System.out.println("请输入两个变量:");
Scanner scanner = new Scanner(System.in);
int num1 = scanner.nextInt();
int num2 = scanner.nextInt();
System.out.println("交换前的顺序为:"+num1+" "+num2);
int num3 = num1;
num1 = num2;
num2 = num3;
System.out.println("交换后的顺序为:"+num1+" "+num2);
int h = 560/60;
int m = 560-60*h;
System.out.println(h+"小时"+m+"分钟");
//3. 个位,十位,百位求和
System.out.println("请输入一个三位数:");
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int sum = num%10+num%100/10+num/100;
System.out.println("和是:"+sum);
//4. 交换变量
System.out.println("请输入两个变量:");
Scanner scanner = new Scanner(System.in);
int num1 = scanner.nextInt();
int num2 = scanner.nextInt();
System.out.println("交换前的顺序为:"+num1+" "+num2);
int num3 = num1;
num1 = num2;
num2 = num3;
System.out.println("交换后的顺序为:"+num1+" "+num2);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询