程序以C编程语言以循环格式(迷宫格式)打印数字 [英] program to print numbers in cyclical format (maze format) in C programming language

查看:87
本文介绍了程序以C编程语言以循环格式(迷宫格式)打印数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


程序定义::以循环(迷宫)格式打印数字
说明:
这里的数字将以循环格式打印,即假设我输入4作为输入,那么此格式的输出应为4 * 4

1 2 3 4
12 13 14 5
11 16 15 6
10 9 8 7

您会看到数字是循环格式的..

1)在x轴上从1-4起
2)从y轴的4-7开始
3)x轴从7-10开始
4)y轴从10-12开始
5)x轴从12-14开始
6)在y轴上从14-15开始
6)x轴从15-16开始

请帮帮我,我真的很喜欢这个程序...

问候,
Krunal Panchal

Hi,
Program Definition :: Print Numbers in Cyclical (Maze) Format
Explaination:
Here numbers are to be printed in cyclical format i.e. suppose i enter 4 as input then the output should be of 4*4 in this format

1 2 3 4
12 13 14 5
11 16 15 6
10 9 8 7

You could see that the numbers are in cyclical format..
i.e
1) from 1-4 in x axis
2) from 4-7 in y axis
3) from 7-10 in x axis
4) from 10-12 in y axis
5) from 12-14 in x axis
6) from 14-15 in y axis
6) from 15-16 in x axis

Please help out me , i am really stucked with this program...

Regards,
Krunal Panchal

推荐答案

搜索Ulam的螺旋线.这应该为您提供一个起点.
Search for Ulam''s spiral. That should give you a starting point.


这篇关于程序以C编程语言以循环格式(迷宫格式)打印数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆