哈工大C语言程序设计精髓MOOC慕课 周编程题答案 下载本文

n块砖( 27

men=0,women=4,children=32 程序的运行结果示例2: Input n(27

men=3,women=3,children=30 程序的运行结果示例3: Input n(27

men=2,women=14,children=20 men=7,women=7,children=22 men=12,women=0,children=24 输入提示: \输入格式: \

输出格式:\*/

#include \

main() {

printf(\ long n, i, t, s = 0; scanf(\ int a, b, c;

for (a = 0; 4 * a <= n; a++)

for (b = 0; 4 * a + 3 * b <= n; b++)

for (c = 0; 4 * a + 3 * b + c / 2 <= n; c += 2)

if (4 * a + 3 * b + c / 2 == n && c%2 == 0 && a+b+c==36)

{ printf(\ } }\

\

int main()

{int year,month,day;

printf(\scanf(\switch(month)

{

case 1: day=31;break; case 2: day=28;break; case 3: day=31;break; case 4: day=30;break; case 5: day=31;break; case 6: day=30;break; case 7: day=31;break; case 8: day=31;break; case 9: day=30;break; case 10: day=31;break; case 11: day=30;break; case 12: day=31;break;

default:day=-1;printf(\}

if((year%4==0&&year0!=0||year@0==0)&&month==2) if (day!=-1)

printf(\return 0; }\

\

unsigned int ComputeAge(unsigned int n){

day=29; } main() {

int i, j, k, s = 23, n, c, age; scanf(\

printf(\}\

\

int gys(int a,int b) {

int r; r=a%b;

if(r==0) return b; else return gys(b,r); } main() {

printf(\ int a,b;

scanf(\ if (a<=0 || b<=0){

printf(\