求大神用C#的for语句编写个图形,样子如下:
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/07/31 15:43:00
求大神用C#的for语句编写个图形,样子如下:
1
121
12321
1234321
12321
121
1
跪求了 谢谢
如果能输入数字 让他变大小的最好了 不行就做死的 再次感谢
1
121
12321
1234321
12321
121
1
跪求了 谢谢
如果能输入数字 让他变大小的最好了 不行就做死的 再次感谢
int x = 4;
for (int i = 0; i < 2 * x - 1; i++){
if (i < x) {
int y = 1;
for (int j = 0; j < 2 * x - 1; j++) {
if (y > 0) {
if (j < (x - i - 1)) {
Console.Write(" "); }
if (j >= (x - i - 1) && j < x - 1) {
Console.Write(y++); }
if (j >= x - 1) {
Console.Write(y--); } }
else {
Console.Write(" ");} }
Console.Write("\n");}
else {
int y = 1;
for (int j = 0; j < 2 * x - 1; j++){
if (y > 0){
if (j < (i - x + 1)) {
Console.Write(" "); }
if (j >= (i - x + 1) && j < x-1) {
Console.Write(y++); }
if (j >= x-1) {
Console.Write(y--);}}
else {
Console.Write(" ");} }
Console.Write("\n"); }}
for (int i = 0; i < 2 * x - 1; i++){
if (i < x) {
int y = 1;
for (int j = 0; j < 2 * x - 1; j++) {
if (y > 0) {
if (j < (x - i - 1)) {
Console.Write(" "); }
if (j >= (x - i - 1) && j < x - 1) {
Console.Write(y++); }
if (j >= x - 1) {
Console.Write(y--); } }
else {
Console.Write(" ");} }
Console.Write("\n");}
else {
int y = 1;
for (int j = 0; j < 2 * x - 1; j++){
if (y > 0){
if (j < (i - x + 1)) {
Console.Write(" "); }
if (j >= (i - x + 1) && j < x-1) {
Console.Write(y++); }
if (j >= x-1) {
Console.Write(y--);}}
else {
Console.Write(" ");} }
Console.Write("\n"); }}
求大神用C#的for语句编写个图形,样子如下:
用VS 2005编写,怎么用C#循环语句在屏幕上用”*”打印输出等腰三角形的图形?
用for语句打印如下图形
编写打印如下图形的程序 (必须用循环语句实现) * ** *** **** *****
几道c#的题目,要求全用c#语句编写,
用for语句编写程序输出如下图案.
用for语句怎么编写出这个图形
C# 输入n个数,求最大的数.用for语句循环写
1、用For循环语句实现下列的图形 2、请用循环结构编写下列图形的程序 * ** *** **** *****
用C#语言编写:输入一个正整数n,程序打印出该整数的所有约数(不包括1和该整数本身)使用for循环语句
怎么用java编写如下程序在屏幕上输出如下图形 * *** *** * 循环语句做(if语句)
分别用for,while,do...while语句编写程序,实现求前N个自然数之和.