1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-27 08:26:20 +00:00
202401-programming-assignments/【实践课外】11.函数2/6-6 重复显示(递归).md

48 lines
623 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 6-6 重复显示(递归)
请编写函数,重复显示字符。
#### 函数原型
```
void Show(int number, char symbol);
```
说明:参数 number 为自然数symbol 为显示字符。函数将重复输出 number 个 symbol 字符。
#### 裁判程序
```c
#include <stdio.h>
void Show(int number, char symbol);
int main()
{
int n;
char s;
scanf("%d %c", &n, &s);
Show(n, s);
putchar('\n');
return 0;
}
/* 你提交的代码将被嵌在这里 */
```
要求:用递归方法完成函数的设计,不得使用循环语句。
#### 输入样例
```in
5 *
```
#### 输出样例
```out
*****
```