Title: Print Image
James found shapes and texts in the castle of Planet X:
Rank = 3
*
**
**
****
Rank = 5
*
**
**
****
**
****
****
********
**
****
****
********
****
********
********
****************
Ran = 6
*
**
**
****
**
****
****
********
**
****
****
********
****
********
********
****************
**
****
****
********
****
********
********
****************
****
********
********
****************
********
****************
****************
********************************
James made his brains and wrote the following program to print the image.
# Define N 70
Void f (char a [] [N], int rank, int row, int col)
{
If (rank = 1 ){
A [row] [col] = '*';
Return;
}
Int w = 1;
Int I;
For (I = 0; I <rank-1; I ++) w * = 2;
____________________________________________;
F (a, rank-1, row + w/2, col );
F (a, rank-1, row + w/2, col + w );
}
Int main ()
{
Char a [N] [N];
Int I, j;
For (I = 0; I <N; I ++)
For (j = 0; j <N; j ++) a [I] [j] = '';
F (a, 6, 0, 0 );
For (I = 0; I <N; I ++ ){
For (j = 0; j <N; j ++) printf ("% c", a [I] [j]);
Printf ("\ n ");
}
Return 0;
}
Analyze the program logic carefully and enter the missing code section.
Submit answers in a browser. Do not fill in the existing code in the question. Do not write any additional content (such as descriptive text)
Answer: f (a, rank-1, row, col + w/2)
Relatively simple recursion