public class A03 { public static void main(String[] args) { // TODO Auto-generated method stub for (int i = 0; i < 10; i++) { for (int j = 0; j <30; j++) { if(30-i-j>0){ int sum=i*3+j*2+1*(30-i-j); if(sum==50){ System.out.println("男"+i+"\t女:"+j+"\t小孩:"+(30-i-j)); } } } } } }
java-第六章-for-马克思数学问题一共30人男花3元女2元小孩1元动50元男女小孩多少人?
时间: 2024-12-01 18:07:48