| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 617 人关注过本帖
标题:在线等答案-----图形题
只看楼主 加入收藏
maxkaoyan
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2005-4-22
收藏
 问题点数:0 回复次数:5 
在线等答案-----图形题
输入n值,输出如图所示回行方阵:
当n=5时:
               33333
               32223
               32123
               32223
               33333

当n=6时:
               333333
               322223
               321123
               321123
               322223
               333333

[此贴子已经被作者于2005-5-16 17:46:24编辑过]


搜索更多相关主题的帖子: 在线 图形 
2005-05-16 17:44
musicml
Rank: 1
等 级:新手上路
帖 子:273
专家分:0
注 册:2005-4-2
收藏
得分:0 
明天帮你 做
太晚了
我要睡觉了

Every thing is possible.
2005-05-17 01:13
yang_sxin
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2005-5-17
收藏
得分:0 
...
等楼上得答案看ing...

2005-05-17 13:44
Rank: 1
等 级:新手上路
帖 子:255
专家分:0
注 册:2005-4-25
收藏
得分:0 

main() {int n,x,y,y1,y2,i,j;

scanf("%d%d",&n,&x); if(n%2)y=n/2+1; else y1=n/2,y2=n/2+1; for(i=1;i<=n;i++) {for(j=1;j<=n;j++) {if(n%2)y=y;else if (i>n/2)y=y2;else y=y1; if(j>(n/2+n%2)-abs(i-y)&&j<=n-(n/2+n%2)+abs(i-y))printf("%3d",x-(n/2+n%2)+abs(i-y)+1); else {if(n%2)y=y;else if (j>n/2)y=y2;else y=y1;printf("%3d",x-(n/2+n%2)+abs(j-y)+1);}} printf("\n");}

getch(); } 看看我做的 任意数的回文正方 输入任意两个数即得图案 输入第一个数是正方形的边长 输入第二个数是初始数字


/bbs/showimg.asp?BoardID=5&filename=2005-4/2005427111228529.jpg" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://bbs./bbs/showimg.asp?BoardID=5&filename=2005-4/2005427111228529.jpg');}" onmousewheel="return imgzoom(this);" alt="" /> 欢迎加入C语言QQ群698156 我们都是菜鸟乃至新手 坚信有一天定能展翅高飞 因为有着努力的决心 衷心盼望你的到来 让我们一起进步
2005-05-17 17:35
maxkaoyan
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2005-4-22
收藏
得分:0 

能行
期待简化版本!!

2005-05-18 09:03
Rank: 1
等 级:新手上路
帖 子:255
专家分:0
注 册:2005-4-25
收藏
得分:0 
要简化版?
printf("3333");
printf("3223");
printf("3223");
printf("3333");
这个够简化吧?

/bbs/showimg.asp?BoardID=5&filename=2005-4/2005427111228529.jpg" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://bbs./bbs/showimg.asp?BoardID=5&filename=2005-4/2005427111228529.jpg');}" onmousewheel="return imgzoom(this);" alt="" /> 欢迎加入C语言QQ群698156 我们都是菜鸟乃至新手 坚信有一天定能展翅高飞 因为有着努力的决心 衷心盼望你的到来 让我们一起进步
2005-05-18 11:45
快速回复:在线等答案-----图形题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016413 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved