c语言的考试题

来源:百度知道 编辑:UC知道 时间:2024/06/06 06:47:28
输出以下图案 使用数组方法
#####
#####
#####
#####

#include <stdio.h>
main()
{
char s[6]="#####";
int i;
for(i=1;i<=5;i++)
printf("%s\n",s);
}
main 前最好加上viod,不然在机上运行,会有一个警告,任何函数都有一个返回值,加了void则没有返回值!^-^

#include <stdio.h>
main()
{
char s[6]="#####";
int i;
for(i=1;i<=5;i++)
printf("%s\n",s);
}