********************
Triplicate loop source code www.2cto.com
********************
# Include "stdio. h"
Void main (void)
{
Int a, B, c;
For (a = 1; a <21; a ++)
For (B = 1; B <34; B ++)
For (c = 1; c <100; c + = 3)
{
If (5 * a + 3 * B + c/3 = 100) & (a + B + c = 100 ))
Printf ("\ n 100 yuan can buy % d rooster % d hen % d chicken! \ N ", a, B, c );
}
Getchar ();
}
**********************
Dual-cycle source code
**********************
# Include "stdio. h"
Void main (void)
{
Int a, B;
For (a = 1; a <21; a ++)
For (B = 1; B <34; B ++)
{
If (5 * a + 3 * B + (100-a-b)/3 = 100) & (100-a-b) % 3 = 0 ))
Printf ("\ n 100 yuan can buy % d rooster % d hen % d chicken! \ N ", a, B, 100-a-b );
}
Getchar ();
}
Beginners learn, the code is very rough, and the program is very simple, so there is no need to comment, there are a lot of online source code, just a small exercise!