Joke Collection Website - Cold jokes - C language programming

C language programming

//? Solution: The problem of bears eating corn.

# include & ltstdio.h & gt

int? EatCorn(int? God)? //? Recursively ask the bear to eat corn

{

If (days == 1)

Return? 1;

Or what? return((eat corn(days- 1)+ 1)* 2); ? //? The bear eats more than half of the day before every day.

}

Invalid? Major (invalid)

{

printf("%d\n ",eat corn( 10));

}

//? Diamond problem

# include & ltstdio.h & gt

Invalid? Major (invalid)

{

For what? (int? I = 0; I < = 6; i++)? //? Number of control lines, ***7 lines

{

What if? (Me<4)? //? Control the first four lines

{

For what? (int? j = 0; j & lt= 2-I; j++)

? printf("%s ","?" ); ? //? Control the left clearance

For what? (int? m = 0; m & lt= I * 2; m++)

? printf(" * ");

printf(" \ n ");

}

Or what? //? Control the last three lines

{

? For what? (int? v = 4; v & lt= I; v++)

? printf("%s ","?" );

? for(int? n = 0; n & lt= 12-2 * I; n++)? //? The principle is to subtract 2 after line 5 (inclusive)

? printf(" * ");

? printf(" \ n ");

}

}

}

//? Special explanation of principle:

//? When i=4, then 12-2*4=4 (don't misunderstand that there are 4 asterisks, but 5 asterisks, and the subscripts start from 0, and the same is true below).

//? When i=5, then 12-2*5=2.

//? When i=6, then 12-2*6=0 1, and the program menu is very simple. Mainly to investigate the ASCII code, we only need to convert char into ASCII code and judge whether it is a number of 1-6. If not, return or give an appropriate prompt. In this respect, writing code is too simple.

1), 2) and 3) don't understand the meaning of the question.