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

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(\

} else

printf(\}\

\

int median(int a, int b, int c) {

if(a

if(b

else{return a

No repeated digit! 输入提示:\输入格式: \输出格式:

有重复数字,输出信息: \

没有重复数字,输出信息: \*/

#include <> int main() {

int log[10]= {0},a[100]; int b,i=0,n,c,d; printf(\ scanf(\ while(n!=0) {

b=n; n/=10; a[i]=b; i++; } a[i]=n; int flag=0; for(c=0; c

if(a[c]==a[d])