编程题:用*号输出字母C的图案
用 * 号输出字母 C! **** * * ****
N诺智能批改可自动批改答案并给出反馈,每次使用将消耗 1个诺币
您当前的诺币数量: 个
N诺正在智能批改,预计需要30秒,请稍候...
int main() { int rows = 4; int cols = 4; for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { // 第一行和最后一行全输出星号 if (i == 0 || i == rows - 1) { printf("*"); } // 中间行只输出第一个星号 else if (j == 0) { printf("*"); } // 其他位置输出空格 else { printf(" "); } } printf("\n"); } return 0; }
#include <stdio.h> int main() { printf("****\n"); printf("*\n"); printf("*\n"); printf("****\n"); return 0; }
#include <stdio.h>
#include "stdlib.h"
#include "math.h"
int main(){
for(int i=0;i<4;i++){
for(int j=4;j>0;j--){
if(i==0) printf('#');
if(i==1){
printf('#');
continue;
}
if(i==2){
if(i==3) printf('#');
return 0;
1
#include<iostream>
using namespace std;
void manifest(int length)
{
if(length==0)
return;
cout<<"*";
manifest(length-1);
int main()
manifest(4);
cout<<endl;
manifest(1);
程序分析:可先用'*...
登录后提交答案