捅咕's profile纯粹捅咕BlogListsGuestbook Tools Help

纯粹捅咕

十年磨一剑,霜刃未曾试。 Tonggu.org
18 November

原来雪人还可以这么堆~

俺太没艺术细胞了
11 November

一个旋转数字的算法

11月11日
一个旋转数字的算法
先看结果:
n=1 显示
__1

n=2 显示
__1 __2

__4 __3

n=3 显示
__7 __8 __9

__6 __1 __2

__5 __4 __3

n=4 显示
__7 __8 __9 _10

__6 __1 __2 _11

__5 __4 __3 _12

_16 _15 _14 _13

n=5 显示
 _21 _22 _23 _24 _25

_20 __7 __8 __9 _10

_19 __6 __1 __2 _11

_18 __5 __4 __3 _12

_17 _16 _15 _14 _13

实现的方法有很多种
可以采用二维数组的方式
也可以采用递归的方式
但第一次学编程,刚刚学过条件判断和循环
花了一整天的时间,写出了一个只用条件判断和循环的算法
所以记忆特别深刻,不过原来的代码已经不记得了
今天闲来无事,用递归实现了一下
权当休息
如下:
 
<script>
function w(n)
{
   if (n<100) document.write("<font color=white>_</font>");
   if (n<10) document.write("<font color=white>_</font>");
   document.write(n + " ");
}
function wrln(m, n)
{
   if (m == 1)
   {
      w(1);
      return;
   }
  
   var x = m * m - m + 1;
   if (m % 2 == 1)
   {
      if (n == 1)
      {
         for (var i = 0; i < m; i++)
         {
            w(x + i);
         }
      }
      else
      {
         w(x - n + 1);
         wrln(m-1, n-1); 
      }
   }
   else
   {
      if (n != m)
      {
         wrln(m-1, n);
         w(x - (m - n));
      }
      else
      {
         for (var i = 0; i < m; i++)
         {
            w(x + m  - 1 - i);
         }        
      }
   }
}
function wr(n)
{
   for (var i = 1; i <= n; i++)
   {
      wrln(n, i);
      document.write('<br><br>');
   }
}
wr(1);
wr(2);
wr(3);
wr(4);
wr(5);
  
</script>
09 November

这30年。。。zz

下海经商、深圳海南淘金、炒原始股、倒腾国库券、个体承包集体企业、早点进外企、开外贸工厂、挖煤、搞边境贸易、06年以前买了房、早点去干IT、1000-6000的A股大牛市、08年做空期货、被拆迁、1600-3000+的本轮A股行情………………
02 November

评:十大年内最赚钱公司出炉

看看吧,6个银行,3个能源,1个保险
最赚钱的公司不是靠吃利息差,就是靠垄断资源赚钱
这些都是无法提高劳动生产力的公司
这是不正常的现象,
是对其他创造类公司的不公
什么时候中国能出现科技公司类的赚钱场面
至少像微软,华为之类的公司,社会经济才能走向进步
 
十大年内最赚钱公司出炉:工行第1中石油第3
http://finance.QQ.com  2009年11月02日04:18   广州日报   我要评论(10)

排行

公司名称

前三季度净利润(元)

1

工商银行

999.1亿

2

建设银行

861.62亿

3

中国石油

813.48亿

4

中国银行

620.56 亿

5

中国石化

497.14亿

6

中国神华

247.20亿

7

交通银行

22875亿

8

中国人寿

252.26 亿

9

招商银行

189.99亿

10

中信银行

113.95亿

数据来源:上市公司三季报

28 October

今天你Win7了吗

赶在Windows7正式上市第二天尝个新
界面当然不错
速度比Vista快乐不少(据说)
用win7的原因主要因为速度提高了
另外新的笔记本性能还不错
用老xp有点大车拉小马了
如果说vista是windows me的话
那win7可以看作是windows 2000了
就像win2k刚上市也有不少问题
win7的兼容性还有待提高
不能像xp在桌面上添加web项了
都改小工具了
临时做个了个小工具
自动在桌面上显示沪指的K线,如下
 
下载地址: 
 
 
 
雁过留声
Please wait...
Sorry, the comment you entered is too long. Please shorten it.
You didn't enter anything. Please try again.
Sorry, we can't add your comment right now. Please try again later.
To add a comment, you need permission from your parent. Ask for permission
Your parent has turned off comments.
Sorry, we can't delete your comment right now. Please try again later.
You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
Complete the security check below to finish leaving your comment.
The characters you type in the security check must match the characters in the picture or audio.