例1:百鸡百钱--一天,车夫子想用100文钱买100只鸡,卖家告知公鸡2文钱1只,母鸡1文钱1只,小鸡1文钱2只:请问在每种鸡至少买一只的情况下哪些组合方式可以刚好花完100文钱购买100只鸡? //公鸡i,母鸡j,小鸡k for (int i = 1; i < 50; i++){ for (int j = 1; j < 100; j++) { for (int k = 2; k < 100; k++) { //
#5.1 major = 'Software Engineering' print("Is major =='Software Engineering'? I predict True.") print(major=='Software Engineering') print("Is major =='Software Engineering'? I predict False.") print(major=='Computer Science') #5.2 pri
习题1:取一个四位数,求各个位数数字的和package Day2; import java.util.Scanner; public class Demo01 { public static void main(String[] args){ Scanner in = new Scanner(System.in); System.out.println("请输入你的卡号"); int cardNum = in.nextInt(); // 1234 int i1 = cardNum %