一个PASCAL程序

Like
Like Love Haha Wow Sad Angry
5

自己编的

program sequence(input,output);
{$r-,s-,q-}
var
       a:array[1..10] of 0..1;
       input,output:text;
       x,y,n,w:longint;
       i:longint;
       s:longint;
function xny(a,b,c:longint):longint;
       var
           tv:integer;
       begin
           c:=1;
           for tv:=1 to b do
               c:=c*a;
       xny:=c;
       end;
begin
       for i:=1 to 10 do
           a[i]:=0;
       s:=0;
       assign(input,'sequence.in');
       reset(input);
       readln(input,n,w);
       close(input);
       i:=10;
       while w>0 do
           begin
               a[i]:=w mod 2;
               w:=w div 2;
               i:=i-1;
           end;
               for i:=1 to 10 do writeln(a[i]);
       for i:=10 downto 1 do
               begin
                   if a[i]=1 then s:=s+xny(n,10-i,y);
               end;
        assign(output,'sequence.out');
        rewrite(output);
        writeln(output,s);
        close(output);
end.

哪位大虾优化一下input: [‘input] n. 输入

2006-12-20
Like
Like Love Haha Wow Sad Angry
5

你的计算机启蒙是谁?

Like
Like Love Haha Wow Sad Angry
71

后续:两年后,我写了《记孙正威老师 | 黃河青山


感觉好像没什么值得说道的,对大家来讲。我个人觉得比较有意义的倒是有一件。在五年级的时候,有一个信息老师选拔数学比较好的人去学计算机竞赛,一共选了六个人。那个年代,不要说计算机竞赛了,就是计算机(对我来说)也是很遥远的东西。我还没有自己的电脑呢,只是偶尔会对着电脑店的广告单垂涎。

这个老师在小学很有名,叫孙正威,我经常在机房的电脑上看到以他为名的文件夹,或者是他创建的文件等。但是之前并没有上过他的计算机课,只是听说他很严厉。

Continue reading “你的计算机启蒙是谁?”

Like
Like Love Haha Wow Sad Angry
71

快乐

Like
Like Love Haha Wow Sad Angry

某天,一个小孩出生了。

他出生在一个知识分子家庭。

从他记事开始,他就在接受教育。

人们教他认字,教他读书。小孩觉得很没意思,他对外面充满了向往,因为他从未出去过。当接触到“快乐”这个词的时候,他无法理解那是什么东西。

上小学了,小朋友们都在一起玩,他却不。别人邀请他一起玩,他却不敢答应。

渐渐地他开始适应学校生活,然而就在这时,他才接触到了真正的教育。1、2年级时的考试十分简单,家长、老师也并不在意。可是之后,考试的分量陡增。他重又回到了如“童年”般的日子。他渐渐在考试中取得领先,同学们都很羡慕他,而他却不快乐。他期望像别的孩子一样尽情玩耍。

他考上了重点中学,结交了很多朋好友。中学的教育是更加残忍的。尽管孩子们不在意考试的分数,社会的主流人群却还是在意的。但就在这样的压迫下,孩子还是学会了玩。中学时光是叛逆的日子。在那时逃课打篮球、夜不归宿去KTV对他来说是多么快乐啊!但好景不长,家长很快注意到了这一点,并开始控制他的活动。无奈,孩子最终还是选择了屈服。

他的天资很高,高中又考上了重点学校。父母很快乐,可他依然不。一次作文课,作文题目是”快乐“,他根本无从下手。老师对这样优秀的学生写不出文章很诧异,问他,他不敢说为什么,敷衍了几句。高中的时光本应是自由、快乐的,而他却从未曾体会到。在父母的思想教育下,他似乎开始认识考试的重要性,并为之付出了不少的努力。

不出所料,他考上了重点大学。他想,我终于可以体会快乐了吧,于是他与同学一起出去游乐。可不知为什么,他怎么也体会不到初中时的感觉。而且,他的成绩也大不如从前,几乎被退学。这时他似乎又开始觉悟,改变自己的态度,度过了4年充实的大学时光。

毕业后,他被分配到某机关工作。他想起了学生时代学过的,他决定做一个清官,并认为那样一定会快乐。可是现实和理想总是有差距的,他非但没有快乐,还几乎丢掉工作。看着其他人快乐的样子,他开始顺应潮流。但这也没有使他快乐,反而使他觉得生活是压抑的。

他有了儿子,他依照父母的方法教育孩子。孩子成绩很好,但看着孩子阴沉的面孔,他也快乐不起来。

度过了几十年时光,他退休了。他竭尽全力寻找快乐,可是却始终没有能找到,至死也没有找到。他很疑惑,本曾拥有的东西,为何现在却如此隐秘。

临死时,他问道:“快乐到底在哪儿呢?!”

其实快乐本就在他身边,他也曾接触过。他却自发地逃避快乐,直到快乐已不复存在。

2008-10-26

Like
Like Love Haha Wow Sad Angry

信念

Like
Like Love Haha Wow Sad Angry

小时候,我就对地球以外的世界深感兴趣。虽然住在城市里,并没有看到满天繁星的机会,但我还是喜欢想象。我买了很多讲人类探索宇宙的努力的书,看了很多这样的漫画(主要是蓝猫淘气三千问)。正是这种憧憬带我走向了科学。

许多年过去了,我现在专注数学(而不是科学)。但是深邃的星空依然对我意味着许多。我不关心金钱、荣耀、名誉或别的什么,因为我相信有些别的东西远比它们伟大——它们只在人类社会生效,其背后的欺骗和伪装,在浩瀚的宇宙中,更是不值一哂。 Continue reading “信念”

Like
Like Love Haha Wow Sad Angry

An Animation and the Middle Age

Like
Like Love Haha Wow Sad Angry
1

This weekend I came across the anime Spice and Wolf. The character Horo is so cute, but this is not what I want to mention most.

It was in the Middle Age, Lawrence, the main character is a travelling merchant. Therefore trading activities and religious organizations(sorry I can’t find an equivalent word) are often mentioned in the story. That inspired me to the imagination of the Middle Age.

It was a dark age that religious power controlled the society, and however, an age of merchants. There were villages, towns, cities, ports and kingdoms. There were missionaries, knights, mercenaries and kings. It was hard to transmit information. It was hard to transport substances. It was a solid age. And it was merchants, who traveled everywhere for more benefits, that liquefied the age. Continue reading “An Animation and the Middle Age”

Like
Like Love Haha Wow Sad Angry
1

Diary (Sep 4, 2010)

Like
Like Love Haha Wow Sad Angry

The book From Calculus to Cohomology by Madsen looks a nice book. Well, it’s the first time I saw an introduction to topology from CALCULUS so I believe it amazing. Maybe I am too ignorant in mathematics.

I’m studying Commutative Algebra and Topology recently. As far as I’m concerned, categories are fundamental in mathematics so I’m particularly fond of algebra in favor of the concept of category. I saw some one says geometry and topology structures are much more interesting than algebra structures. I don’t understand it very much. Maybe in my mind all structures are algebraic. Well, maybe when we adopt measures and Cauchy sequences we are entering the field of Analysis, Geometry and Topology? Actually in my heart it is still algebraic. I think continuity doesn’t mean non-algebra. Continue reading “Diary (Sep 4, 2010)”

Like
Like Love Haha Wow Sad Angry

我们如何思考?

Like
Like Love Haha Wow Sad Angry

When I say “apple” ,an apple will appear in your mind. You can understand it. People may explain it as some correspondence between images and specific signs. And the signs themselves are images so actually we associate the images with sounds and then sounds with signs. Humans have evolved so much that today they can understand written language in silence, not needing to read them out.

The understand of concrete things may be as easy as the above. But what about that of abstract things, concepts and statements? That should be hard to explain because explanation itself is an abstract statement, which I must use my understanding system of abstract things to understand.

I used to guess, the approach to solve this problem is up to science. That is, to study the brain. But there is still a critical obstacle that we still have to think using our brain.

Is that the unreachable acme of human cognition? Do humans have to continue evolving to answer it? Or never?

2010-09-04

Like
Like Love Haha Wow Sad Angry

A Testing Post

Like
Like Love Haha Wow Sad Angry

Human and Natural Disasters

Human activities are largely involved in the formation of some natural disasters, while not involved in the formation of some others.

As we all know, it is obvious that humans have nothing to do with the formation of volcano eruptions or earthquakes. But some other disasters, for instance, sandstorms, are related to human activities. Overgrazing and overcutting ruin vegetation, in turn causing desertification. When sands meet a windstorm, a sandstorm comes into being. Another instance is acid rain. Waste gas produced in industry activities, mostly in thermal powering, goes up to the clouds. It then blends with the water vapors. As a result, the rain from the clouds becomes acid, doing a lot of harm to humans, animals, plants, etc. Continue reading “A Testing Post”

Like
Like Love Haha Wow Sad Angry

從張鈺哲說開去

Like
Like Love Haha Wow Sad Angry
1

大概一年級的時候,看一本書,名字忘了,反正講的是宇宙啊、星星啊、航天啊相關的知識(或者八卦?),與之配套的還有一本講地球的。那時我就是這麼喜歡這種書,經常成套地買。有一天就看到一段講月蝕和日食,說是雖然日食發生的比月蝕還要頻繁一點,很多人一輩子都沒見過日食卻見過月蝕,爲什麼呢,它說因為日食能看到的只是一小片區域,畢竟月球能擋住的小,而地球則是整個把月球都擋住了,另外日食時間短,就更容易受天氣影響。這時候就舉了個例子,說是某年中國某地發生日食,古稀之年的張鈺哲先生趕過來,適逢陰雨天憾而沒能看到。配圖是一位瘦削、長臉的老者,頗有混血風範。其時就對張鈺哲這個人很感興趣,然而那個時代信息閉塞,我一個小城市的小屁孩,沒有網絡,上哪去主動獲取信息呢?但這種好奇就一直在我腦中徘徊不去。另,我當時的眼光反而落在“古稀”一詞上更甚,一是沒什麼文化,覺得很新鮮,二個,是書的另一處講到人的壽命,說活七十歲,其實才兩萬多天,而那已經是“人生七十古來稀”了,我就常常覺得悲哀,因為各種書上常常提到冥王星公轉要二百多年,哈雷彗星也要七十幾年才迴歸一次云云。

而後很多年,都沒有網絡。日子一天天地過,到初一有了網,我又沉迷遊戲(黑歷史就在QQ空間,感興趣可以慢慢翻),然後又英語、又數學、又政治、又數碼地,就淡忘了這些事。 Continue reading “從張鈺哲說開去”

Like
Like Love Haha Wow Sad Angry
1