- 博客(5)
- 问答 (1)
- 收藏
- 关注
原创 百钱买百鸡
公鸡5文钱1只,母鸡3文钱1只,小鸡3只1文钱,100文钱买100只鸡,有几种买法?package wenye;public class Demo4 { public static void main(String[] args) { for(int cock=0;cock<=20;cock++) { for(int hen=0;hen<=33;hen++) { if(cock*5+hen*3+(100-cock-hen)/3==100 &&(100
2022-03-14 21:02:32
96
原创 编写程序,对输入的整数,按相反数输出该数
package wenye;import java.util.Scanner;public class Demo1 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.print("请输入一些数:"); int num=sc.nextInt(); int a; while(num!=0) ...
2022-03-14 20:06:21
454
空空如也
用 while 循环,计算 1~200 之间所有 3 的倍数之和。
2022-03-14
TA创建的收藏夹 TA关注的收藏夹
TA关注的人