gpt4 book ai didi

c - C 中的打印符号

转载 作者:行者123 更新时间:2023-11-30 21:28:35 25 4
gpt4 key购买 nike

预先感谢您提供的任何帮助。我正在尝试根据 M 和 N 给出的值打印“+”符号板(因此,如果是 M:3 和 N:1,它将显示为+++),但我画的是绝对空白关于你如何做到这一点。代码是 C 语言。

编辑:澄清。我不记得我需要做什么来根据给定的值打印电路板。我很清楚,如果我现在运行这段代码,它会显示为空白。

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {
int N, M;

printf("N: ");
scanf("%d",&N);
printf("M: ");
scanf("%d",&M);
printf("\n");

/* Show a board with N lines and M columns */


return 0;
}

最佳答案

帮助您入门

for(int i = 0; i < N; i++)
{
printf("X");
}

关于c - C 中的打印符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40552144/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com