1: #include <string.h>
2: #include <stdio.h>
3:
4: int Accord(int i, int j, int k);
5:
6: int main()
7: {
8: int i, j, k;
9: for (i=0; i<=100; i++)
10: for (j=0; j<=100; j++)
11: for(k=0; k<=100; k++)
12: if(Accord(i, j, k))
13: printf("cock=%d,, hen=%d, chick=%d \n", i, j, k);
14: return 0;
15: }
16:
17: int Accord(int i, int j, int k)
18: {
19: if (5*i+3*j+k/3 == 100 && k%3==0 && i+j+k==100)
20: return 1;
21: else
22: return 0;
23: }