博文

ACM II(2008-04-06 00:28:00)

摘要:输入_第三类: l       输入不说明有多少个Input Block,但以某个特殊输入为结束标志。        参见:HDOJ_1091 Problem Description Your task is to Calculate a + b.     Input Input contains multiple test cases. Each test case contains a pair of integers a and b, one pair of integers per line. A test case containing 0 0 terminates the input and this test case is not to be processed.     Output For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.     Sample Input 1 5 10 20 0 0     Sample Output 6 30     Author lcy     Recommend JGShining   Hdoj_1091源代码: #include <stdio.h> int main() {        int a, b;        while(scanf("%d %d", &a, &b) && (a != 0 && b != 0))      ......

阅读全文(5029) | 评论:0

ACM basic of input(2008-04-06 00:27:00)

摘要:Basic input and output   输入_第一类:   输入不说明有多少个Input Block,以EOF为结束标志。 参见:HDOJ_1089 Problem Description Your task is to Calculate a + b.Too easy?! Of course! I specially designed the problem for acm beginners. You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.     Input The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.     Output For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.     Sample Input 1 5 10 20     Sample Output 6 30     Author lcy     Recommend JGShining     Hdoj_1089源代码: #include <stdio.h>  int main()  {     int a,b;         while(scanf("%d %d",&a, &b)......

阅读全文(4417) | 评论:0

The flavor of translation(2008-04-03 02:11:00)

摘要:  Low-level slash-and-burn farming doesn’t harm rainforest. On the contrary, it helps farmers and improves forest soils. This is the unorthodox view of a German soil scientist who has shown that burnt clearings in the Amazon, dating back more than 1,000 years, helped create patches of rich, fertile soil that farmers still benefit from today.  Most rainforest soils are thin and poor because they lack minerals and because the heat and heavy rainfall destroy most organic matter in the soils within four years of it reaching the forest floor. This means topsoil contains few of the ingredients needed for long-term successful farming.    But Bruno Glaser, a soil scientist of the University of Bayreuth, has studied unexpected patches of fertile soils in the central Amazon. These soils contain lots of organic matter.Glaser has shown that most of this fertile organic matter comes from “black carbon”-the organic particles from camp fires and charred (烧成炭的) wood left over......

阅读全文(2514) | 评论:0

英语六级起步(2008-04-02 14:58:00)

摘要:指代、如何开头、如何衔接。The dawn of the new century witnessed the increasing popularity of the web.-->obsession 迷恋(跨段)整合两段内容、并具有概括能力。模仿句型:instant coffee grew rapidlly in popularitythe mobile phone has grown rapidlly in popularitysales level off: sales remained constant/steady/stable/much the samesales went into a small decline: sales declined slightly/ dramatically/ substantially/ sharply/ greatly/ hugely归纳,预测。-->tapping student's potential 开发学生的潜力-->lose its vitalily gradually 逐步失去活力-->dominate 控制、支配 -->coherent 连贯的 -->flaw 缺点插入语、倒装强调句Not only but also -->coordinated 协调的总结考点(对比考点)。无中生有 -->initiative 主动性On average/ For instance.学学怎么开头 -->versus 对 -->curricula 课程 -->splinter 碎片读完最好翻译一下. 进一步的解释说明、原因分析。to do less, but in greater depth. 同义互换, 定位与替换。注意BUT引起的强调。BECAUSE,因果关系考点 标志词识别句子之间的关系 -->decentralize 分散 -->counterpart 地位、作用相当的人或物-->intellectual 理智的 -->propose 建议 -->babble 嘈杂声、胡言乱语 -->controversy 争论but, however, ulimately 转折、对比词d c 同义词,同一范畴的词,"强调",和......

阅读全文(2036) | 评论:0

清华研友介绍的经验(2008-03-28 23:57:00)

摘要:清华研友介绍的经验 本帖我给我们学生会的文章的草稿,补充的在底下我是从普通的学校(我们学校没有什么名气,但我对它很有感情,所以把原来的“三流”两个字改了)考请华的,今年四百二十多,复试也不错,应该问题不大。我是应届的,本科的情况是高数挂过上下册,还有其他一些学得很糟的课程,学得很好的几乎没有。对于考研,我没有报过辅导班,没有租房子住,考研期间也没去清华找过导师,我也不是很聪明,这些都不重要。我感觉最重要就是坚持,坚持到底,当然是坚持学习,偶尔的郁闷是很正常的,但是千万不要坚持郁闷。另外一点是就是要知道刻苦和努力的区别,有的人够努力,因为他天天学,但他学的都是他学得很好的,他喜欢学的,这种人不够刻苦,刻苦就是自己越不喜欢学什么就越去学什么,因为自己越不喜欢学的往往是自己最需要学的,也就是自己最短的那根木头,自己的软肋。 具体学习应该是按弱点,重点,强项的顺序复习。弱点就是是刚才说的最短的那根木头,也就是软肋,重要性不用说。重点是保证自己的分数不是刚刚过线。强项发挥了就可以有所突破,到复试的时候就一般没什么问题,能够轻松一点了。我个人认为找导师是有必要,特别是初始成绩不高的同学,因为清华面试是350,口语和听力分别是20和30,专业笔试也才100。如果你事先找到导师,导师就有可能主动参加你的面试,或者至少帮你打个招呼,这样你就比较主动了。但我还认为找导师最好的是在初始成绩出来再说,因为这时你才不用空口说白话,找导师很简单,去清华,找到系馆打听到导师的房间直接敲门进去说:“老师,我想跟你”。(清华本科时有srt,本科生跟着自己心仪的导师作了几年有感情了,到保研的时候一句话就行了,所以等到外校的考进去,大部分牛人早就名花有主了,所以大家找导师的时候要理智)要抓住实质,能力很重要,但清华的老师也了解,考不上四百的不一定没有能力,但考上四百的一般都有能力。另外就是要有一颗平常心,因为一颗浮躁的心会遮蔽你的眼睛,让你看不到实质看到不重点。 补充一:我自己的特点是高度专一,也就是我有可能几个月就学一样,大一英语很差,其末考试都是四十来分,四级前的一百天我其它什么都没学,就专学英语,后来,四六级都答了八十多分,考研的时候英语就没什么问题了,我开始正式准备是在考研前的三百天,花了三个月时间专攻数学把数学搞定了,然后我们那时有个专业课竞赛,我给自己的目标是全省第一,所以就全身心投入......

阅读全文(2369) | 评论:3

带头结点单链表的实践(2008-03-27 02:45:00)

摘要:à1.数据结构及说明 typedef struct node {        int number;        struct node *next; }LNode, *LinkList;   à2.算法设计及说明 1)建立带头结点的单链表 首先申请空间建立头结点和第一个结点;q指向第一个结点,扫描输入第一个结点的数据;p指向q;while循环,当扫描输入的q的数据域的值不等于结束标志时,p指向新开辟的空间;再输入数据,用于下一次循环判断;p指向q,连接新的q结点;p跳到q上,准备连接下一个新的结点;当循环推出后,置尾结点指针域为空指针;最后返回头结点,链表建立完毕。 2)将值为x的结点插入一个按整数值递增的带头结点的单链表中,仍保持有序 在递增单链表中插入值,使之仍保持有序的关键在于:找到p结点的前驱结点q,然后在q之后插入s即可。   àError LINKLIST.C 43: Type mismatch in redeclaration of ‘list’ 错因分析:list函数在主函数之后,应在主函数之前加以函数声明,或者直接将list函数放在主函数之前即可解决。   à在第一步的基础上,对源程序进行细化和修正时,对新插入的结点S,只给它申请了空间,并未把X的值赋给待插入结点的数据域,导致出来的结果是个随机值,运用了“打印输出”的调试思想,及时的发现了问题并予以改正。     àProgram begin to create the linklist!! Please input the first data: 5 Please input the oter data: 16 Please input the oter data: 31 Please input the oter data: -1   5 16 31 与预期结果吻合,成功实现了用“尾接法”带头节点(便于标识且操作统一)创建线性单链表,并顺次输出各个结点。   àProgram begin to create the linklist!! ......

阅读全文(6256) | 评论:0

Linux进程的创建与通信(2008-03-26 01:50:00)

摘要:gcc -o fork fork.c./fork Thinkpad@LENOVO-77052164 ~$ gcc -o fork fork.c Thinkpad@LENOVO-77052164 ~$ ./forkThe return value is 3420The return value is 0 In father process!! In child process!! My PID is 376 My PID is 3420 Thinkpad@LENOVO-77052164 ~$ lsfork.c  fork.exe Thinkpad@LENOVO-77052164 ~$ lsexeclp.c  fork.c  fork.exe Thinkpad@LENOVO-77052164 ~$ gcc -o execlp execlp.c Thinkpad@LENOVO-77052164 ~$ lsexeclp.c  execlp.exe  fork.c  fork.exe Thinkpad@LENOVO-77052164 ~$ ./exelpbash: ./exelp: No such file or directory Thinkpad@LENOVO-77052164 ~$ ./execlp Thinkpad@LENOVO-77052164 ~$      UID     PID    PPID TTY     STIME COMMAThinkpad    3752       1 con  01:06:59 /usr/biThinkpad    1452       1 con  01:29:18 /usr/bi Thinkpad@LENOVO-77052164 ~$ lsexecle.c  exe......

阅读全文(2226) | 评论:0

Linux Programming(2008-03-24 22:44:00)

摘要:  [root@LinuxServer thinkpad]# rm -f * dd2dd :q! yyp :set nu:set nonu:3 gcc 2.9.5.3 gnu cc [root@LinuxServer thinkpad]# ./a.out[root@LinuxServer thinkpad]# gcc -o test test.c[root@LinuxServer thinkpad]# gcc -g -o test test.c [root@LinuxServer thinkpad]# gcc -c test.c[root@LinuxServer thinkpad]# lsa.out  test  test.c  test.o -O -O2-g Makefile/makefilemake test: prog.o code.o gcc -o test prog.o code.oprog.o: prog.c prog.h code.h gcc -c prog.c -o prog.ocode.o: code.c code.h gcc -c code.c -o code.oclean: rm -f *.o #make target OBJS=prog.o code.oCC=gcctest: ${ OBJS } ${ CC } -o test ${ OBJS }prog.o: prog.c prog.h code.h ${ CC } -c prog.c -o prog.ocode.o: code.c code.h ${ CC } -c code.c -o code.oclean: rm -f *.o [root@LinuxServer thinkpad]# lstest.c[root@LinuxServer thinkpad]# gcc -g -o test test.c [root@LinuxServer thinkpad]# gdb testGNU gdb Red Hat Linux (5.3post-0.20021129.18rh)Copyright 2003 Free Software Foundati......

阅读全文(3702) | 评论:0

Linux网络应用(2008-03-24 18:26:00)

摘要:0.5 kw*h14 h“口代表交流与沟通,亡代表危机意识,月代表时间,贝代表筹码即可以为自己加分的要素,凡代表一颗平常心。”他的精彩报告让 同学们知道要成功必须学好专业知识,善于交流沟通,要惜时如金,要学无止境,要有平和的心态。 #rpm -ivh samba-client-2.2.7a-7.9.0rpm -qa | grep samba [root@LinuxServer RPMS]# rpm -qa | grep sambasamba-client-2.2.7a-7.9.0samba-2.2.7a-7.9.0redhat-config-samba-1.0.4-1samba-common-2.2.7a-7.9.0 mount -t nfs 192.168.0.112:/home /mnt/nfsumount /mnt/nfs /sbin/service smb start(stop)\\192.168.0.2......

阅读全文(2007) | 评论:0

RedHat Linux 9.0安装Samba服务(2008-03-24 17:00:00)

摘要:首先验证您的机器中是否已经安装samba   rpm -qa|grep samba,如果出现   samba-common-2.2.7a-7.9.0   samba-client-2.2.7a-7.9.0   samba-2.2.7a-7.9.0   那么恭喜你,你已经安装好了samba,如果没有以上那些东东,请安装,安装方法很简单,redhat   linux 9.0第一张光盘里就有//cdrom/RedHat/RPMS/   以下是我的详细安装过程:   把第一张光盘放进光驱,他会自动挂接的,省得自己动手mount了   #cd /mnt/cdrom/RedHat/RPMS(主意大小写字母,否则会出错的啊)   #rpm -ivh samba-common-2.2.7a-7.9.0 (这个要先安装,安装的时候不一定要把后面的samba-common-2.2.7a-7.9.0全部写完,比如写到samba-c的时候,多按几次Tab键,很省事的哦)   #rpm -ivh samba-2.2.7a-7.9.0   #rpm -ivh samba-client-2.2.7a-7.9.0(客户端)   安装了以上的东西之后,基本上就可以了,但为了配置的方便以及利用REDHAT LINUX9.0新特性,我建议在安装以下两个东东redhat-config-samba-1.0.4-1,samba-swat-2.2.7a-7.9.0光盘里都有,其中redhat-config-samba-1.0.4-1在第一张光盘里,samba-swat-2.2.7a-7.9.0在第二张光盘里,安装方法和上面的一样了.   通过上面的简单介绍,我想你已经安装好了,试验一下 #rpm -qa|grep samba(这是什么含义应该知道吧,如果不知道,建议先学学LINUX的基本命令)   redhat-config-samba-1.0.4-1   samba-common-2.2.7a-7.9.0   samba-client-2.2.7a-7.9.0   samba-swat-2.2.7a-7.9.0   samba-2.2.7a-7.9.0......

阅读全文(2790) | 评论:0