1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package
本章总结;
public
class
A02 {
public
static
void
main(String[] args) {
// TODO Auto-generated method stub
for
(
int
i =
0
; i <
20
; i++) {
for
(
int
j =
0
; j <
33
; j++) {
if
(i+j+(
100
-i-j)==
100
){
if
(
5
*i+
3
*j+(
100
-i-j)/
3
==
100
){
System.out.print(
"\n公鸡:"
+i);
System.out.print(
"母鸡:"
+j);
System.out.print(
"雏鸡:"
+(
100
-i-j));
}
}
}
}
}
}
|
本文转自 Y幕徐 51CTO博客,原文链接:http://blog.51cto.com/765133133/1426324