2011国信蓝点杯C语言组初赛最后两道题代码
第二届“国信蓝点”软件设计大赛_C语言模拟题(附程序题答案)

第二届“国信蓝点” C语言软件设计以下是简答题:1、代码填空形如:“abccba”,“abcba”的串称为回文串,下列代码判断一个串是否为回文串。
请补充空白的部分。
char buf[] = "abcde11edcba";int x = 1;for(int i=0; i<strlen(buf)/2; i++)if(___________________){x = 0;break;}printf("%s\n", x ? "是":"否");(3分)2、代码填空下列代码把一个二进制的串转换为整数。
请填写缺少的语句;char* p = "1010110001100";int n = 0;for(int i=0;i<strlen(p); i++){n = __________________;}printf("%d\n", n);(4分)3、代码填空假设a,b,c是3个互不相等的整数。
下列代码取出它们中居中的数值,记录在m中。
其中的swap()函数可以交换两个变量的值。
请完善代码。
if(a>b) swap(&a, &b);if(b>c) swap(&b, &c);______________________;int m = b;(4分)4、代码填空下面函数的目的是求出某个日期是该年度的第几天。
试完善之。
如果传入:year=1980,month=1, day=1则返回 1如果传入:year=1980,month=2, day=1则返回32int getDayOfY ear(int year, int month, int day){int days _____________________;int flag =(year%4==0 && year%100!=0) || year%400 == 0 ? 1 : 0;int sum = day ;for(int i=0;i<month;i++) {sum += days[flag][i];}return sum;}(8分)5、代码填空计算3个A,2个B可以组成多少种排列的问题(如:AAABB, AABBA)是《组合数学》的研究领域。
2011noip普及组初赛试题(c语言)

第十七届全国青少年信息学奥林匹克联赛初赛试题(普及组●● C 语言两小时完成)一、单项选择题(共20 题,每题 1.5 分,共计30 分。
每题有且仅有一个正确选项。
)1.在二进制下,1100100 + ()= 1110001A. 1011B. 1101C. 1010D. 1111 。
2.字符“0”的ASCII 码为48,则字符“9”的ASCII 码为()A. 39B. 57C. 120D. 视具体的计算机而定3.一片容量为8GB 的SD 卡能存储大约()张大小为2MB 的数码照片。
A. 1600B. 2000C. 4000D. 160004.摩尔定律(Moore's law)是由英特尔创始人之一戈登·摩尔(Gordon Moore)提出来的。
根据摩尔定律,在过去几十年以及在可预测的未来几年,单块集成电路的集成度大约每()个月翻一番。
A. 1B. 6C. 18D. 365.无向完全图是图中每对顶点之间都恰有一条边的简单图。
已知无向完全图G 有7 个顶点,则它共有()条边。
A. 7B. 21C. 42D. 496.寄存器是()的重要组成部分。
A. 硬盘B. 高速缓存C. 内存D. 中央处理器(CPU)7.如果根结点的深度记为1,则一棵恰有2011 个叶结点的二叉树的深度最少是()A. 10B. 11C. 12D. 138. 体育课的铃声响了,同学们都陆续地奔向操场,按老师的要求从高到矮站成一排。
每个同学按顺序来到操场时,都从排尾走向排头,找到第一个比自己高的同学,并站在他的后面。
这种站队的方法类似于()算法。
A. 快速排序B. 插入排序C. 冒泡排序D. 归并排序位。
9.一个正整数在二进制下有100 位,则它在十六进制下有()位。
A. 7B. 13C. 25D. 不能确定10.有人认为,在个人电脑送修前,将文件放入回收站中就是已经将其删除了。
这种想法是()。
A. 正确的,将文件放入回收站意味着彻底删除、无法恢复B. 不正确的,只有将回收站清空后,才意味着彻底删除、无法恢复C. 不正确的,即使将回收站清空,文件只是被标记为删除,仍可能通过恢复软件找回D. 不正确的,只要在硬盘上出现过的文件,永远不可能被彻底删除11.广度优先搜索时,需要用到的数据结构是()。
第11届全国青少年信息学奥林匹克分区联赛江西赛区初级组初赛笔试试题(2005年)QBASIC

第十一届全国青少年信息学奥林匹克竞赛(2005年)(初级组BASIC语言二小时完成)一、基础知识单项选择题(每小题2分,共20分)1、计算机中1个字节所包含二进制位的个数是()A、2B、3C、10D、10242、能将高级语言编写的源程序转换成目标程序的是()A、编辑程序B、转换程序C、编译程序D、链接程序3、与十六进制整数100等价的十进制整数是()A、256B、512C、1024D、20484、Window应用环境中使用鼠标的托运不能完成的操作是()A、当窗口不是最大化时,可以移动窗口的位置B、当窗口最大化时,可以将窗口缩小成图标C、当窗口有流动条时可以实现窗口内容的流动显示D、可以将一个文件移动(或复制)到另一个文件夹中去5、在Windows环境下,如果“资源管理器”左窗口中的某些文件夹左边标有“+”标记,则表示()A、该文件夹为空B、该文件夹中含有子文件夹C、该文件夹只包含有可执行文件D、该文件夹中包含系统文件6、在window环境下,单击当前应用程序窗口的“关闭”按钮,其功能是()A、将当前应用程序转为后台运行B、退出Window后再关机C、退出window后重新启动计算机D、终止当前应用程序的运行7、字长为32位的计算机是指()A、该计算机能够处理的最大数不超过32B、该计算机中的CPU可以同时处理32位的二进制信息C、该计算机的内存量为32MBD、该计算机每秒钟所能执行的指令条数为32MIPS8、下面四种文件格式中()不能表示声音文件格式。
A、wavB、JpegC、RmD、Mp39、第三代电子计算机所采用的基本逻辑器件是( )A、半导体B、三极管C、集成电路D、电子管10、Internet上流行的BBS指的是()A、文件传输B、语音聊天室C、一种网络游戏D、电子公告板二、阅读程序填空题(每空3分,共30分)1、阅读程序写出运行结果。
DEF FNA(y)=y+1DEF FNS(y)=FNA(6)^2+Fna(y)+y^2+y+1PRINT FNS(2)END运行结果为:()2、A、B、C、D、E、F这六位同学围成一圈报数。
2011“国信蓝点杯”全国软件专业人才设计与开发大赛模拟题

2011“国信蓝点杯”全国软件专业人才设计与开发大赛华中科技大学文华学院选拔赛(C 语言程序设计本科组、高职高专组)上机编程试题一、倒序数是将一个阿拉伯数的各位上的数字以逆序的形式写成的数。
该阿拉伯数的第一位变成最后位,最后位变成第一位。
例如数1245 被写成5421。
注意产生的新数字前边所有的数字0 是被略去的。
倒序数的尾部无多余的数字0。
请将阿拉伯数转变为倒序数。
输入输入的第一行仅有一个正整数n,表示有n 组测试数据。
接下来有n 行,每一行是一组测试数据,长度不超过100。
每一行上的字符串表示一个非负整数,它是你需要转换的数。
输出对每一组测试数据在一行上输出倒序数,该倒序数中前导的数字0 被略去了。
输入样例 3 24 43400 305 503 42 434 (25 分)输出样例#include<stdio.h>int main() { int n,t,m = 0; scanf("%d",&t); for(;t--; m = 0) { scanf("%d",&n); while(n) { m = m * 10 + n%10; n /= 10; } printf("%d\n",m); } return 0; } 二、对一个正整数n,求出n!中末尾0 的个数。
输入输入有若干行。
每一行上有一个整数T,是测试数据组数,接着有T 行,每一行包含一个确定的正整数n(n≤1000000000)。
输出对输入行中的每一个数据n,输出一行,其内容是n!中末尾0 的个数。
输入样例3 3 100 1024 0 24 253 (25 分)输出样例#include<stdio.h>int main() { int n,t,cnt = 0; scanf("%d",&t); for(;t--; cnt = 0) { scanf("%d",&n); for(int i=2,temp = 1; i <= n; ++i) { temp *= i; while(!(temp%10)) ++cnt,temp /= 10; temp %= 100; } printf("%d\n",cnt); } return 0; } 三、给定两个字符串a 和b,定义式子a*b 表示两个字符串的连接。
2011全国软件设计开发大赛样题.c.本科---参考答案

2011 模拟c语言本科注意:本套模拟题主要模拟命题形式与考核范围。
真实竞赛题的数量、难度可能与此套模拟题有差异。
说明:本试卷包含两种题型:“代码填空”与“程序设计”。
填空题要求参赛选手在弄清给定代码工作原理的基础上填写缺失的部分,使得程序逻辑正确、完整。
所填写的代码不多于一条语句(即不能出现分号)。
编程题要求选手设计的程序对于给定的输入能给出正确的输出结果。
注意:在评卷时使用的输入数据与试卷中给出的实例数据可能是不同的。
选手的程序必须是通用的,不能只对试卷中给定的数据有效。
1.代码填空(满分2分)下列代码,把一个2位整数交换十位与个位的位置。
请填写缺失的代码。
例如:当x=95时,返回59。
int switch_num(int x){int a = x / 10;int b = x % 10;return __10*b+a_______________;}2.代码填空(满分3分)下列代码把一个二进制的串转换为整数。
请填写缺少的语句;char* p = "1010110001100";int n = 0;for(int i=0;i<strlen(p); i++){n = _____________;}printf("%d\n", n);n = __n*2+(p[i]-'0')________;3.代码填空(满分3分)假设a,b,c是3个互不相等的整数。
下列代码取出它们中居中的数值,记录在m中。
其中的swap()函数可以交换两个变量的值。
请完善代码。
if(a>b) swap(&a, &b);if(b>c) swap(&b, &c);______________________; if(a>b) swap(&a, &b);int m = b;4.代码填空(满分5分)计算3个A,2个B可以组成多少种排列的问题(如:AAABB, AABBA)是《组合数学》的研究领域。
2011国信蓝点本科模拟题及答案 C语言

2011 模拟c语言本科注意:本套模拟题主要模拟命题形式与考核范围。
真实竞赛题的数量、难度可能与此套模拟题有差异。
说明:本试卷包含两种题型:“代码填空”与“程序设计”。
填空题要求参赛选手在弄清给定代码工作原理的基础上填写缺失的部分,使得程序逻辑正确、完整。
所填写的代码不多于一条语句(即不能出现分号)。
编程题要求选手设计的程序对于给定的输入能给出正确的输出结果。
注意:在评卷时使用的输入数据与试卷中给出的实例数据可能是不同的。
选手的程序必须是通用的,不能只对试卷中给定的数据有效。
1.代码填空(满分2分)下列代码,把一个2位整数交换十位与个位的位置。
请填写缺失的代码。
例如:当x=95时,返回59。
int switch_num(int x){int a = x / 10;int b = x % 10;return _b*10+a______;}2.代码填空(满分3分)下列代码把一个二进制的串转换为整数。
请填写缺少的语句;char* p = "1010110001100";int n = 0;for(int i=0;i<strlen(p); i++){n = _n*2 + p[i] - '0'_;}printf("%d\n", n);3.代码填空(满分3分)假设a,b,c是3个互不相等的整数。
下列代码取出它们中居中的数值,记录在m中。
其中的swap()函数可以交换两个变量的值。
请完善代码。
if(a>b) swap(&a, &b);if(b>c) swap(&b, &c);if(a>b) swap(&a, &b);int m = b;4.代码填空(满分5分)计算3个A,2个B可以组成多少种排列的问题(如:AAABB, AABBA)是《组合数学》的研究领域。
但有些情况下,也可以利用计算机计算速度快的特点通过巧妙的推理来解决问题。
蓝桥杯最后一道题2102(C语言解决方法)外加俄罗斯方块

#include <stdio.h>#include <string.h>char a[30]="1 2 3 4 5 6 7 8 9";char ch[4]="-+ ";int Diao(char *a){int b[30],sum[30]={0};int i,k,j=0,l=0;for(i=0;i<strlen(a)+1;i++){if(a[i]==' ');else{if(a[i]>='0'&&a[i]<='9'){b[j++]=a[i]-'0';}else{for(k=0;k<j;k++){sum[l]=sum[l]*10+b[k];}j=0;l++;}}}j=0;for(i=0;i<strlen(a);i++){if(a[i]=='+'){sum[j+1]+=sum[j];j++;}else if(a[i]=='-'){sum[j+1]=sum[j]-sum[j+1];j++;}}return sum[j];}void A(char *a,int i,int j){int h;if(Diao(a)==110)printf("%s=110\n",a);else if(i>j);else{for(h=0;h<=2;h++){a[i+1]=ch[h];A(a,i+2,j);}}}int main(){A(a,0,16);return 0;}-------------------------------------------------------------------------------------------------------------Tc2.0 编写俄罗斯方块游戏很多编程爱好者都编写过俄罗斯方块的游戏程序。
c语言全国各届信息技术大赛试题(值得计算机专业学习).doc

5有n个人围成一圈,顺序排号,从第一个人开始报数(从1到3报数),凡是数到3的人退出圈子,问最后留下的是原来的几号的那个人。
#include <stdio.h> void main(){int n, i, k, m;int array[50], *p;printf(M please input the number of persons: n = \n H);scanf("%d", &n);p = array;for (i 二0; i v n; i++)*(p+i) = i+1;i = 0; //i为每次循环计数变量k = 0; // k为按1,2,3报数时的计数变量m = 0; // m为退岀人数计数变量while(m < n-l) 〃当退出人数比n-1少时执行循环体{if( *(p+i) != 0 )k++;if(k == 3) //对退出的人编号置为0{*(p+i) = 0;k 二0;m++;}i++;if(i == n)i = 0;}while(*p == 0)p++; printf("The last one isNo. %d\n",*p);6编写一个函数求字符串的长度。
并在main 函数中输入字符串,并输出其长度。
#include <stdio.h> void main(){int strLen(char *str);intlen;char string[20];printf("please input a string: \n M);scanf(”%s”, string);len = strLen(string);printf("The length of the string is: %2d\n", len);}int strLen(char *str){char *p;int count = 0;p = str;while(水p){P++; count++;}return (count);}7有一个字符串,包含n个字符。
noip初赛c语言试题及答案

noip初赛c语言试题及答案1. 选择题1.1 以下哪个选项是C语言中合法的变量名?A. 2variableB. variable2C. intD. _variable1.2 正确答案是 D。
变量名可以以字母或下划线开头,不能以数字开头,也不能是C语言的关键字。
1.3 以下哪个选项是C语言中合法的整型常量?A. 0x1AB. 0123C. 1.2E3D. 0b10101.4 正确答案是 A。
0x1A 是十六进制表示的整数,0123 是八进制表示的整数,1.2E3 是浮点数,0b1010 是二进制表示的整数,但不是合法的C语言常量。
1.5 以下哪个选项是C语言中合法的字符串常量?A. "Hello, World!"B. 'Hello, World!'C. "HelloD. "Hello\"1.6 正确答案是 A。
"Hello, World!" 是合法的字符串常量,'Hello, World!' 是字符常量,"Hello 是不完整的字符串常量,"Hello\" 是非法的字符串常量,因为反斜杠后面没有字符。
2. 填空题2.1 以下C语言代码中,变量a的值是多少?```cint a = 5;printf("%d", a);```2.2 答案是 5。
变量a被初始化为5,然后通过printf函数输出。
2.3 以下C语言代码中,变量b的值是多少?```cint b = 10;b = b + 5;printf("%d", b);```2.4 答案是 15。
变量b被初始化为10,然后增加5,最后输出15。
3. 编程题3.1 编写一个C语言程序,计算并输出100以内所有偶数的和。
```c#include <stdio.h>int main() {int sum = 0;for (int i = 1; i <= 100; i++) {if (i % 2 == 0) {sum += i;}}printf("Sum of even numbers from 1 to 100 is: %d\n", sum);return 0;}```3.2 程序的输出是:Sum of even numbers from 1 to 100 is: 2550。
蓝桥杯c 试题及答案

蓝桥杯c 试题及答案蓝桥杯是中国著名的计算机竞赛,由中国计算机学会主办,每年举办一次。
其中,C语言组是比赛的一个重要环节,考察选手对于C语言程序设计的理解和应用能力。
以下是蓝桥杯C语言组试题及答案的整理,供参赛选手参考和学习。
第一题:找素数题目描述:请编写一个程序,计算给定范围内的素数个数,并输出结果。
输入:输入两个正整数n和m(1 <= n, m <= 1000,n <= m),表示要计算的范围。
输出:输出一个整数,表示该范围内的素数个数。
样例输入:2 10样例输出:4解题思路:素数是指只能被1和自身整除的整数,根据这个定义,我们可以使用一个循环来判断每个数是否为素数。
具体实现时,首先需要判断一个数n是否为素数,可以从2开始将n除以每个数,若能整除则说明n 不是素数;反之,则n是素数。
将这个判断的逻辑封装成一个函数,然后在给定的范围内遍历每个数,统计出素数的个数即可。
代码实现:```c#include <stdio.h>int isPrime(int n) {if (n <= 1) {return 0;}for (int i = 2; i * i <= n; i++) {if (n % i == 0) {return 0;}}return 1;}int countPrimes(int n, int m) {int count = 0;for (int i = n; i <= m; i++) {if (isPrime(i)) {count++;}}return count;}int main() {int n, m;scanf("%d %d", &n, &m);int result = countPrimes(n, m);printf("%d\n", result);return 0;}```参考答案如上所示,该程序通过调用判断素数的函数,并在给定范围内进行循环判断,最终输出结果。
2011年全国大学生英语竞赛C类初赛、决赛真题及答案汇总集(原创)

2011年全国大学生英语竞赛样题(C级)Part IListening Comprehension (25 minutes, 30 marks)Section A(5 marks)Directions: In this section, you will hear 5 short conversations. At the end of each conversation, a question will be asked about what was said. Both the conversation and the question will be read only once. After each question, there will be a pause. During the pause, you must read the three choices marked A, B and C, and decide which is the best answer. Then mark the corresponding letter on the Answer Sheet with a single line through the centre.1. A. The man is not suitable for the position.B. The job has been given to someone else.C. She hadn't received the man's application.2. A. He is going to see his section chief.B. He is going to have a job interview.C. He is going to see his girlfriend.3. A. Ask to see the man's ID card.B. Get the briefcase for the man.C. Show the man her documents.4. A. The dorm room is too crowded.B. There is no kitchen in the building.C. No one looks after the dorm building.5. A. She was always in good shape.B. She stopped exercising one year ago.C. She lost a lot of weight in one year.Section B (10 marks)Directions: In this section, you will hear two long conversations. Each conversation will be read only once. At the end of each conversation, there will be a one-minute pause. During the pause, you must read the five questions, each with three choices marked A, B and C, and decide which is the best answer. Then mark the corresponding letter on the Answer Sheet with a single line through the centre.Conversation One6. What is soon to open in China?A. The French Movie Festival.B. The French Cultural Year.C. The French Food Festival.7. How many exhibitions will be held for this activity?A. 200.B. 20.C. 100.8. What will be held at the foot of the Great Wall?A. The City Concert.B. The Opening Ceremony.C. The Great Lunch.9. Which of the following cities is not included in this activity?A. Chongqing.B. Wuhan.C. Shenzhen.10. What will certainly make great contributions to this activity?A. Internet.B. TV shows.C. Newspapers.Conversation Two11. What sound more like a native speaker in a casual conversation?A. Examples.B. Verbs.C. Idioms.12. Which of the following sounds more informal and more natural?A. Get together.B. Meet.C. See.13. Which of the following means that you cannot interrupt me?A. I'm tied up.B. I have a lot on my plate.C. I'm busy.14. In American culture, what is considered important in a conversation?A. Using proper languageB. Making eye contact.C. Looking at your own feet.15. In business, how might Americans feel about you if you are looking away?A. You're feeling ashamed.B. You're telling the truth.C. You're telling a lie.Section C (5 marks)Directions: In this section, you will hear 5 short news items. After each item, there will be a pause. During the pause, you must read the question and then the three choices marked A, B and C, and decide which is the best answer. Then mark the corresponding letter on the Answer Sheet witha single line through the centre.16. How long will it take for new forests to grow back?A. 65 years.B. 20 years.C. 40 years.17. What did Jimmy Carter plan to focus his efforts on after leaving the White House in 1981?A. A presidential library.B. Camp David.C. Winning a second term.18. What was regarded as the lifeblood of the country of the Maldives?A. Oil.B. Agriculture.C. Tourism.19. What is responsible for the death of many people in developing countries?A. The development of resistance to diseases.B. The difficulty to cure new emerging diseases.C. The inability of the poor to afford medicine.20. What released an estimated 8.7 million tons of the global warming gas?A. Cars.B. Wildfires.C. Wars.Section D (10 marks)Directions: In this section, you will hear a short passage. There are ten missing words or phrases in it. Fill in the blanks with the exact words you hear on the tape. Remember to write theanswers on the Answer Sheet.A researcher says lead in the environment could be a major cause of violence by young people. Doctor Herbert Needleman is a (21) ________ at the University of Pittsburgh School of Medicine in Pennsylvania and he (22) ________ his findings at the yearly meeting of the American Association for the Advancement of Science. Doctor Needleman says the presence of lead in the (23) ________ changes the neurons that control actions and that can cause a person to act in antisocial and (24) ________ ways.In the 1970s, Doctor Needleman found lower scores on (25) ________ even in children who did not have such signs of lead poisoning. After that, lead was (26)________ gasoline and paint in the United States. Yet many homes still have old lead paint. Lead was also used in older (27) ________. In fact, officials just announced stronger testing and reporting requirements as from next year for lead in American drinking water.The newest research shows that even very small amounts of lead in bones can affect brain development. A simple (28)________ can measure lead except that an X-ray process is needed to measure levels in bone. In 2004, such tests were done on 190 young people who were (29) ________ and the findings showed that their average levels were higher than normal. And, in 1998, three hundred children were studied and the test scores showed higher levels of (30) ________ problems in those with increased levels of lead. Yet these levels were still considered safe by the government.Part II V ocabulary and Structure (10 minutes, 15 marks)Directions: There are 15 incomplete sentences in this part. For each blank there are four choices marked A, B, C and D. Choose the one that best completes the sentence. Then mark the corresponding letter on the Answer Sheet with a single line through the centre.31. So nervous ________ that she didn't know how to start her speech.A. since she becameB. would she becomeC. that she becameD. did she become32. He ________ another career but, at the time, he just wanted to earn money to study abroad.A. might have chosenB. might chooseC. had to chooseD. must have chosen33. The second report was ________ by August 2005, but one year later it was still nowhere in sight.A. submittedB. to have submittedC. to submitD. to have been submitted34. In this experiment, the students studied are stopped several times during the listening test and asked to report what they ________ during the pause before answering the questions.A. had just been thinking aboutB. have just been thinking aboutC. are just thinking aboutD. had just thought about35. I was always taught that it was ________ to interrupt.A. rudeB. coarseC. roughD. crude36. Small boys are ________ questioners. They ask questions all the time.A. originalB. peculiarC. imaginativeD. persistent37. We regret to inform you that the materials you ordered are ________.A. out of workB. out of reachC. out of stockD. out of practice38. The bomb will ________ the moment it is touched.A. go onB. go offC. go outD. go over39. The car won't ________; I've tried it several times, but it won't work.A. beginB. launchC. startD. drive40. Children and old people do not like having their daily ________ upset.A. habitB. routineC. practiceD. custom41. In your first few days at school you'll be given a test to help the teachers to ________ you to a class at your level.A. locateB. assignC. deliverD. place42. China only started its nuclear power industry in recent years, and should ________ no time in catching up.A.loseB.delayC. spareD. relieve43. —You did an excellent job yesterday, Jim! I really enjoyed your presentation.—________—Oh yeah, it was fabulous. It seems the English program is a great way to practice English.—Yeah. It is fun and motivating.A. Did you really?B. Oh, thank you. You are so kind.C. Really? What about yours?D. Not at all. My pleasure.44. —What kind of music do you like?—Well, I like different kinds.—________—Er, I especially like punk rock.A. I beg your pardon?B. Are you serious?C. Any in particular?D. Why do you think so?45. —How did you like the fashion show last night?—________—I didn't see anything wrong with the clothes; they looked pretty nice to me.—Do you really think people can wear that stuff and walk around in streets?A. Impressive. It's a good way to show off women's sense of style and wealth.B. It was cool. The clothes are more beautiful than the people wearing them.C. Nothing serious. It's only a show to attract the eyes of fashion fans.D. It was dumb. I think it's stupid for women to wear clothes like that.Part III Reading Comprehension (20 minutes, 40 marks)Section A (4 marks)Directions: There is one passage in this section with 4 questions. For each question, there are four choices marked A, B, C and D. You should decide on the best choice. Then mark the corresponding letter on the Answer Sheet with a single line through the centre.Questions 46-49 are based on the following passage.The ability to “see”oneself in the future is a remarkable human trait - some would say unique - that is not well understood. That's despite the fact that we probably spend as much timethinking about the future as we do thinking about the present.Now new research from Washington University in St. Louis suggests that it's precisely because we can remember the past that we can visualize the future. “Our findings provide convincing support for the idea that memory and future thought are highly interrelated and help explain why future thought may be impossible without memories,” says doctoral candidate Karl Szpunar. The findings are consistent with other research showing that persons with little memory of the past, such as young children or individuals suffering from loss of memory, are less able to see themselves in the future.The researchers base their conclusions on brain scans of 21 college students who were cued to think about something in their past, and anticipate the same event in the future, like a birthday or getting lost. The experiment was carried out as each student lay on their stomach in a magnetic resonance imaging machine, a dreadful but very useful piece of equipment that can show which areas of the brain are stimulated during specific thought processes.The students were also asked to picture former President Bill Clinton in a past and future setting. Clinton was chosen because he was easily recognized and familiar to all the students.The researchers found a “surprisingly complete overlap”among regions of the brain used for remembering the student's past and those used for picturing the future. And every region involved in remembering was also used in anticipating the future.In short, the researchers isolated the area of the brain that “lit up”when the students thought about an event in their own past. And more importantly, that same area lit up again when they thought about a similar event in their future. In fact, the researchers report that the brain activity was so similar in both cases that it was “indistinguishable.”The findings were reinforced when students imagined Bill Clinton. Since none of them knew him personally, their memories were not autobiographical. And the brain scans showed “significantly less”correlation between memories of having seen pictures of Clinton in the White House and projecting him into the future.So this “time machine,”as the researchers describe it, allows us to use the past to see ourselves in the future, and both our memories and our anticipation are interdependent.46. A remarkable human trait that is not well understood is the ability ________.A. to think about the pastB. to see the futureC. to remember the pastD. to control the present47. The findings support that ________.A. future goals will greatly influence a person's present performanceB. a person's present performance is determined by his / her past knowledgeC. future thought depends to a great degree on the memory of the pastD. present thought is impossible without the ability to imagine the future48. The conclusion of the experiment on students was that ________.A. the students could picture themselves better than Bill Clinton in a past and future settingB. the students could imagine themselves as well as Bill Clinton in a past and future settingC. the students could anticipate Bill Clinton better than themselves in a past and future settingD. the students could only picture themselves in a past and future setting but not Bill Clinton49. This “time machine”in the last paragraph most probably refers to ________.A. clockB. brain scanningC. magnetic resonance imagingD. memorySection B (14 marks)Directions: There is one passage in this section with 10 questions. Go over the passage quickly and answer the questions on the Answer Sheet. For questions 50-55, mark Y (for YES)if the statement agrees with the information given in the passage; N (for NO)if the statement contradicts the information given in the passage; NG (for NOT GIVEN)if the information is not given in the passage. For questions 56-59, complete the sentences with the information given in the passage.Visiting the White HouseWhite House Tours Public tours of the White House are available for groups of 10 or more people. Requests must be submitted through one's Member of Congress and are accepted up to six months in advance. These self-guided tours are available from 7:30 a.m. to 12:30 p.m. Tuesday through Saturday , and are scheduled on a first come, first served basis approximately one month in advance of the requested date. We encourage you to submit your request as early as possible since a limited number of tours are available. All White House tours are free of charge. For the most current tour information, please call the 24-hour line at 202-456-7041. Please note that White House tours may be subject to last minute cancellation.White House Visitor CenterAll tours are significantly enhanced if visitors stop by the White House Visitor Center located at the southeast corner of 15th and E Streets, before or after their tour. The Center is open seven days a week from 7:30 a.m. until 4:00 p.m. and features many aspects of the White House, including its architecture, furnishings, first families, social events, and relations with the press and world leaders, as well as a thirty-minute video. Allow between 20 minutes to one hour to explore the exhibits. The White House Historical Association also sponsors a sales area. Please note that restrooms are available, but food service is not.Mobility-Impaired / Using a WheelchairGuests requiring the loan of a wheelchair should notify the officer at the Visitors Entrance Building upon arrival.Wheelchairs loans are offered on a first-come, first-served basis. Reservations are not possible.Visitors in wheelchairs, or with other mobility disabilities, on the Congressional guided or self-guided tours, between 8:00 a.m. and 12 noon, use the same Visitor entrance and, with up to four members of their party, are admitted without waiting in line and without tickets.Visitors in wheelchairs are escorted by ramp from the entrance level to the ground floor, and by elevator from the ground to the state floor. Guests generally wait in line with their family or group.Hearing-ImpairedTours for hearing-impaired groups may be arranged in advance by writing to the Visitors Office, White House, Washington, DC 20502. Tours are usually scheduled at 9:30 a.m., between the Congressional and public tour times. Participants enter at the East Appointment gate. A U.S. Secret Service / Uniformed Division Tour Officer conducts the tour in sign language. Signed tours are available to groups of 8 to 20. Groups are also encouraged to bring their own interpreters.Signing interpretation is also available for individual visitors with advance notice. ACongressional office first issues guided tour tickets to a guest who is hearing-impaired and then contacts the Visitors Office at least 2 weeks in advance to request interpreter service.The Visitors Office TDD (telephone device for the deaf) is 202-456-2121. Messages may be left outside normal business hours.Visually-ImpairedTours for visually-impaired groups may be arranged in advance by writing to the Visitors Office, White House, Washington, DC 20502. The tours are usually scheduled at 9:30 a.m., between the Congressional and public tour times. Participants enter at the East Appointment gate.A U.S. Secret Service / Uniformed Division Tour Officer permits visitors to touch specific objects in the House. Touch tours are currently available only to groups of 8 to 20, not to individual visitors. Guide animals are permitted in the White House.General Tour InformationAll White House tours are free. Changes in tour schedules are occasionally made because of official events. Notice may not be given until that morning. The Visitors Office 24-hour Information Line recording at 202-456-7041 provides the most up-to-date information. The TDD is 202-456-2121. Visitors should confirm tour schedules by calling the information line the night before and the morning that they plan to visit. It is occasionally necessary to close individual rooms on the tour; however, notice about closed rooms is not possible.Prohibited ItemsProhibited items include, but are not limited to, the following: handbags, book bags, backpacks, purses, food and beverages of any kind, strollers, cameras, video recorders or any type of recording device, tobacco products, personal grooming items (make-up, hair brush or comb, lip or hand lotions, etc.), any pointed objects (pens, knitting needles, etc.), aerosol containers, guns, ammunition, fireworks, electric stun guns, mace, martial arts weapons / devices, or knives of any size. The U.S. Secret Service reserves the right to prohibit any other personal items. Umbrellas, wallets, cell phones and car keys are permitted.Please note that no storage facilities are available on or around the complex. Individuals who arrive with prohibited items will not be permitted to enter the White House.ParkingThe closest Metrorail stations to the White House are Federal Triangle (blue and orange lines), Metro Center (blue, orange, and red lines) and McPherson Square (blue and orange lines). On-street parking is not available near the White House, and use of public transportation is strongly encouraged.Restrooms / Public TelephonesThe nearest restrooms and public telephones to the White House are in the Ellipse Visitor Pavilion (the park area south of the White House) and in the White House Visitor Center. Restrooms or public telephones are not available at the White House.50. Both Congressional guided and self-guided tours need to be scheduled in advance.51. All White House tours are free of charge except on federal holidays.52. The White House Visitor Center provides free drinks but not food service.53. Wheelchair reservation service is provided by the officer at the Visitors Entrance Building.54. Hearing-impaired visitors can request signing interpretation service from the Visitors Office.55. Touch tours are currently only offered to visually-impaired groups of 8 to 20.56. Sometimes official events make it necessary to close ________________ without notice.57. The personal items permitted to be carried into the White House are ________________.58. The transportation visitors are encouraged to use is ________________.59. Inside the White House, visitors cannot find or use restrooms or ________________.Section C (10 marks)Directions: In this section, there is one passage followed by 5 questions. Read the passage carefully, then answer the questions in as few words as possible (not more than 10 words). Remember to write the answers on the Answer Sheet.Questions 60-64 are based on the following passage.If you were on a distant planet, and if you had instruments that could tell you the composition of Earth's atmosphere, how would you know there was life on this planet?Water in the atmosphere would suggest there could be water on the surface, and as we all know water is considered crucial to life. But water would only suggest that life is possible. It wouldn't prove it's there.Carbon? That basic component of “life as we know it?”Not necessarily. A diamond is pure carbon, and it may be pretty, but it isn't alive.What really sets Earth apart is nitrogen, which makes up 80 percent of the planet's atmosphere. And it's there only because there is abundant life on Earth, say scientists at the University of Southern California.The report grew out of a class discussion two years ago in a course taught by Capone and Kenneth Nealson, professor of earth sciences. Students were asked to come up with different ideas about searching for life on other planets. What is a distinct “sign ature,” as Capone puts it, that would show there is life on another planet?That's a question that has been kicked around in many quarters in recent decades, especially since all efforts to find some form of life, no matter whether on Mars or in the distant reaches of space, have failed. At least so far.The current effort to search for some evidence of life on Mars focuses primarily on the search for water, because it has long been believed that water, or at least some fluid, is necessary for the chemical processes that lead life to take place. But that's probably the wrong approach, the USC group argues.“It's hard to imagine life without water, but it's easy to imagine water without life,”says Nealson, who was on the Mars team before moving to USC.But nitrogen would be a much clearer signature of life. Only about 2 percent to 3 percent of the Martian atmosphere is nitrogen. That's just a trace, and it probably means there is no life on Mars today, and if there was in the past, it probably ended many, many years ago.But, the USC team adds quickly, that doesn't mean there's no life anywhere else in the universe. They don't know where, of course, but they may have found a way to narrow down the search. Look first for nitrogen, then look for biological activity that should be there.So if life exists elsewhere, and is similar to life as we know it, there should be nitrogen, and that's what we should be looking for first, the researchers say.If they don't find nitrogen on Mars, Capone says, “that will probably bring us to the conclusion that there likely never was life on Mars.”But how about elsewhere? Could this technique be used to search for life in other solarsystems?Maybe. It might be possible to detect a nitrogen-rich atmosphere around a planet orbiting another star, but not yet. Current instruments aren't that sensitive.If they ever are, the search for life might be narrowed down to the most promising prospects, chiefly because of the presence of nitrogen. And won't that be fun!Questions:60. What can suggest life is possible but cannot be proved according to the author?61. What is a clear “signature”of life on another planet according to Capone?62. What is considered as a wrong way to search for evidence of life on Mars?63. What can probably prove there is no life on Mars today based on the new theory?64. Why is it impossible to use the new technique to search for life in other solar systems now?Section D (12 marks)Directions: In this section, there is one passage followed by a summary. Read the passage carefully and complete the summary below by choosing a maximum of three words from the passage to fill in the spaces 65-70. Remember to write the answers on the Answer Sheet.Questions 65-70 are based on the following passage.In August 2008, athletes from the United States and around the world will compete in the Beijing Olympics. But did you know that in September of next year, disabled athletes will compete in the Paralympic Games in Beijing?The Olympics and the Paralympics are separate movements. But they have always been held in the same year, and since 1988, they have also been held in the same city. The International Olympic Committee and the International Paralympic Committee signed an agreement in 2001 to secure this connection. The next winter games will take place in Vancouver, Canada, in 2010.The Paralympic Games grew out of a sports competition held in 1948 in England and a doctor named Ludwig Guttmann organized it for men who suffered spinal cord injuries in World War II. Four years later, it became an international event as competitors from the Netherlands took part. Then, in 1960, the first Paralympics were held in Rome. 400 athletes from 23 countries competed. By 2004, the Paralympic Games in Athens had almost 4000 athletes from 136 countries, who may have physical or mental limitations and may be blind or in wheelchairs. Yet sometimes they perform better than athletes without disabilities.In 1968, Eunice Kennedy Shriver, the sister of former President John F. Kennedy, started the Special Olympics, which are just for children and adults with mental limitations and whose programs currently serve more than two million people in 160 countries. In November 2006, in Mumbai, India, teams competed in the First Special Olympics International Cricket Cup. In addition to India, there were men's teams from Afghanistan, Australia, Bangladesh, Nepal, Pakistan, Sri Lanka and the West Indies. There were also women's cricket teams from India and Pakistan.There are many organizations in the United States that help people with disabilities play sports. Wheelchair tennis is a popular sport. So is basketball. In fact, there are more than one hundred professional teams playing wheelchair basketball thanks to the special wheelchairs for athletes that are lightweight and designed for quick moves. For people who want to go really fast in their chairs, there is a Power Wheelchair Racing Association.In the state of Utah there is a place called the National Ability Center, which teaches all kindsof sports to people with all kinds of physical and mental disabilities and even gives friends and family members a chance to try a sport as if they were disabled.A reporter from the Washington Post wanted to know what it would be like for a blind person to use a climbing wall. So, protected by a safety line, the newspaper reporter closed his eyes and started to feel for places to put his hands and feet. Trainers on the ground urged him on: “Take your time. You can do it.” Finally he reached the top.At the National Ability Center people can learn to ride horses and mountain bikes. They can try winter mountain sports, and learn scuba diving and other water activities. The center also prepares athletes for the Paralympics.These days, the first place many people go when they want to travel is the Internet, where they can get information about hotels, transportation and services like tour companies. The Internet can also help travelers find special services for the disabled. For example, there are groups that help young people with disabilities travel to different countries.Susan Sygall, who uses a wheelchair herself, leads an organization called Mobility International USA, and has traveled to more than twenty-five countries to talk about the rights of people with disabilities. She says people with disabilities are all members of a global family and working together across borders is the most powerful way of making changes.Summary:The Olympics and the Paralympics are (65) ________ but they have always been held in the same year and also in the same city since 1988 when the International Olympic Committee and the International Paralympic Committee signed an agreement in 2001 to (66) ________. The Paralympic Games grew out of a sports competition organized by a doctor named (67) ________ in 1948 in England for men injured in World War II. In 1952, it became an (68)________ and in 1960, the first Paralympics were held in Rome for people who may have physical or mental limitations or may be blind or in wheelchairs. The (69) ________ was started in 1968 in the United States by Eunice Kennedy Shriver just for children and adults with mental limitations and to help people with disabilities play sports and enjoy other activities, many (70) ________ are founded, such as the Power Wheelchair Racing Association, the National Ability Center and Mobility International USA.Part IV Cloze (15 minutes, 15 marks)Section A: There are 5 blanks in the passage. Use the word given on the right side to form a word that fits in each blank. Remember to write the answers on the Answer Sheet.Maria Callas was one of the best-known opera singers in the world, who became famous internationally for her beautiful voice and intense (71)________ during the 1950s, and the recordings of her singing the well-known operas remain very popular today.Maria Callas was born in New York City in 1923 and her real name was Maria Kalogeropoulous. Her parents were Greek and when she was fourteen, she and her mother returned to Greece, where Maria studied singing at the national conservatory in Athens and the well-known opera (72)________ Elvira de Hidalgo chose Maria as her student.In 1941, when she was 17, Maria Callas was paid to sing in a major opera for the first time. She sang the (73)________ role in several operas in Athens during the next three years. In 1943, Callas was invited to perform in Italy, which was the real beginning of her profession as an opera singer. She performed major parts in several of the most (74)________ operas. In 1949, she married an Italian (75)________, Giovanni Battista Meneghini, who was twenty years older and became her。
蓝信杯.2011.决赛.java.高职

2011年决赛java 高职考生须知:考试时间为4小时。
本试卷包含两种题型:“代码填空”与“程序设计”。
总计100分。
其中代码填空:9+14 = 23 分程序设计:12+28+37 = 77分填空题要求参赛选手在弄清给定代码工作原理的基础上填写缺失的部分,使得程序逻辑正确、完整。
所填写的代码不超过一条语句(即不能出现分号)。
把填空的答案(仅填空处的答案,不包括题面)存入考生文件夹下对应题号的“解答.txt”中即可。
编程题要求选手设计的程序对于给定的输入能给出正确的输出结果。
考生的程序只有能运行出正确结果的时候才有机会得分。
注意:在评卷时使用的输入数据与试卷中给出的实例数据可能是不同的。
选手的程序必须是通用的,不能只对试卷中给定的数据有效。
对每个题目,要求考生把所有类写在一个文件中。
调试好后,存入与考生文件夹下对应题号的“解答.txt”中即可。
相关的工程文件不要拷入。
请不要使用package语句。
另外,源程序中只能出现JDK1.5中允许的语法或调用。
不能使用1.6或更高版本。
1.代码填空(满分9分)题目在考生文件夹下对应题号的“题目.rar”中,请先解压该文件。
解压密码以现场公布为准。
仔细阅读和调试题目提供的源代码,根据要求填写缺失的代码部分。
注意:请把填空的答案(仅填空处的答案,不包括题面)存入考生文件夹下对应题号的“解答.txt”中即可。
直接写在题面中不能得分。
2.代码填空(满分14分)题目在考生文件夹下对应题号的“题目.rar”中,请先解压该文件。
解压密码以现场公布为准。
仔细阅读和调试题目提供的源代码,根据要求填写缺失的代码部分。
注意:请把填空的答案(仅填空处的答案,不包括题面)存入考生文件夹下对应题号的“解答.txt”中即可。
直接写在题面中不能得分。
3.程序设计(满分12分)题目在考生文件夹下对应题号的“题目.rar”中,请先解压该文件。
解压密码以现场公布为准。
仔细阅读题目要求,根据题意编写调试代码。
蓝桥杯真题c语言带答案解析

蓝桥杯真题c语言带答案解析是中国最具影响力的计算机比赛之一,每年都吸引着大量的中学生和大学生参与。
其中,的C语言组赛事备受关注,因为C语言作为计算机领域最基础也是最重要的编程语言之一,对于培养学生的计算机思维和编程能力起着至关重要的作用。
真题是考生备战的重要材料,拥有一套真题可以帮助考生更好地了解考试的难度和题型。
因此,掌握C语言组的历年真题,并进行分析和解析,对于备战十分重要。
在解析真题前,首先需要明确C语言组的考试要求。
C语言组的题目主要考察参赛选手对C语言的掌握程度,包括语法、逻辑思维、程序设计和算法等综合能力。
因此,在解题过程中,需要灵活运用所学的知识,善于分析和解决问题。
让我们以2019年全国赛C语言组的一道题目为例进行解析。
该题目要求计算一个矩阵的置换,即将矩阵的行列互换。
首先,我们需要读取用户输入的矩阵大小,并根据矩阵大小创建一个二维数组来存储矩阵元素。
接下来,我们需要遍历这个二维数组,将矩阵的行列互换。
通过一个临时变量来交换元素的位置即可。
最后,将置换后的矩阵输出。
通过这道题目的解析,我们可以看出,解题过程需要灵活运用数组、循环和条件语句等C语言的基本知识,同时还牵涉到了对算法的理解和应用。
而对于整个C语言组的真题解析,可以从以下几个方面进行分析:第一,了解题型的分布。
C语言组的真题考察范围广泛,既有基础的语法题,也有涉及算法和数据结构的题目。
因此,要全面掌握基本的C语言知识,并且对一些常见的算法和数据结构有一定的了解。
第二,挖掘题目的难点。
在解析真题时,可以重点分析每道题目的难点所在,这样有助于我们在日常练习中更有针对性地选择题目,提高自己的解题能力。
第三,总结解题方法。
在分析真题的过程中,可以总结一些常用的解题思路和方法,以便在实际考试中能够快速应对各种题目。
总的来说,掌握C语言组的历年真题并进行解析,对于备战有着重要的意义。
通过对真题的分析和解析,不仅可以提高我们的编程能力,还能够更好地了解和掌握C语言的应用和实践。
NOIP2011复赛题解

NOIP2011复赛题解noip2011普及组解题报告NOIP2011普及组解题报告——ahbbzeq 2011.11.25 转载请注明来源一、数字反转没得满分只能说明一个问题,你的程序写的太少了。
program reverse;vars:string;i,sta:longint;beginassign(input,'reverse.in');reset(input);assign(output,'reverse.out');rewrite(output);readln(i);str(i,s);sta:=1;if s[1]='-' thenbeginwrite('-');sta:=2;end;i:=length(s);while (s[i]='0') and (i>sta) dodec(i);while (i>=sta) dobeginwrite(s[i]);dec(i);end;close(input);close(output);end.二、统计单词个数考你的基本功,和对程序的理解,尤其是细节上的优化。
直接在文章中选出单词,与给定单词长度一致时才比较,函数传参数时也不要传字符串(会很慢的,具体慢多少没试)。
program stat;vars,p:ansistring;i,j,first,num,len,c,k:longint;function cmp(x:longint):boolean;vari:longint;beginfor i:= 1 to c doif s[i]<> p[x+i-1] then exit(false);exit(true);end;beginassign(input,'stat.in');reset(input);assign(output,'stat.out');rewrite(output);readln(s);readln(p);s:=upcase(s);p:=upcase(p);c:=length(s); len:=length(p);i:=1; num:=0; first:=-1;while (s[i]=' ')and (i<=len) do inc(i);while (i<=len) dobeginj:=i+1;while (p[j]<>' ') and (j<=len) doinc(j);if (j-i = c) and cmp(i) thenbeginif first=-1 then first:=i;inc(num);end;i:=j; while (p[i]=' ') and (i<=len) do inc(i); end;if first=-1 thenwriteln(-1)else writeln(num,' ',first-1);close(input);close(output);end.三、瑞士轮实践证明,如果单纯的排序r次,必然结果是超时。
国信蓝点杯决赛训练试题1

国信蓝点杯决赛训练试题1给定整数集合s和两个整数m,n,是否存在s的一个子集h,使得m是取自h中至多n 个整数的和(可以重复取)。
从输入文件读入若干组测试数据。
每一组测试数据的第一行是三个整数m,n,k,(0≤m≤10000,0≤n≤20,0≤k≤20)。
接着的一行上有k个整数b1,b2,…,bk,表示s由这k个整数组成。
输出直至文件完结。
对第i组测试数据,你应先在一行上输出文字“case#:”,其中“#”是测试数据编号i(从1开始编),再在下一行上输出你能否实现将m表示成s中至多n个数字的和的文字描述:“可能”,并将所有的组合形式输出出来。
否则输出“不可能”输出样例输入样例1033case1:412可能将10=4+4+22753case2:2313不可能2碎纸机游戏设计:你现在负责设计一种碎纸机,使其具有以下特点:①每次研磨之前,先必须取值碎纸机一个目标数,而且在每张被送进碎纸机的纸片上也须要涵盖一个数;②碎纸机切出的每个纸片上都包括一个数;③建议切开的每个纸片上的数的和必须不大于目标数而且与目标数最吻合。
比如,假设目标数就是50,输出纸片上的数是12346。
碎纸机可以把纸片切开4块,分别涵盖1,2,34和6。
这样,这些数的和就是43=1+2+34+6,这就是所有的划分方式中,不少于50而又最为吻合50的划分方式。
又比如说,划分成1,23,4和6就是不恰当的,因为这样的总和就是34=1+23+4+6,比刚才获得的结果43大。
划分成12,34和6也就是不恰当的,因为这时的总和就是52=12+34+6,少于了50。
还有以下3个特别的规则:①如果目标数和输出纸片上的数相同,那么纸片不展开研磨;②如果不论怎样切割,分割得到的纸片上数的和都大于目标数,则显示错误信息;③如果存有多种不同的研磨方式可以获得相同的最优结果,则应当表明出来最优结果的全部赢得方式。
为了设计这样的一个碎纸机,要求你编写一个简单的模拟程序来模拟以上碎纸过程。
国信蓝点杯全国软件专业人才设计与开发大赛

“国信蓝点杯”第二届全国软件专业人才设计与开发大赛选拔赛竞赛规则及样题更新时间:2011-1-6 8:29:15 /1.时间:考试为4小时全程封闭。
2.形式:全程机考。
局域网络、浏览器方式发放试题、提交代码。
3.考试环境X86 兼容机器,内存>1G,硬盘>60GWindows NT 内核系统(WindowsXP, Windows2000等)●C 语言Visual C++ 6.0 (英文版)MSDN帮助文档(中英文)Turbo C●JavaJDK 1.5Eclipse 3.1JCreator 2.0API 帮助(英文,中文,chm格式)4.涉及知识∙ ●JAVA软件开发(本科)涉及知识:语法、面向对象、网络编程、接口、集合、IO、多线程、内部类、异常、数据结构。
(awt、swing不考)∙ ●JAVA软件开发(高职高专)涉及知识:语法、面向对象、网络编程、接口、集合、IO、多线程、内部类、异常。
(数据结构、awt、swing不考)∙ ●C语言程序设计(本科)涉及知识:结构、数组、指针、标准输入输出、递归、函数指针、文件I/O、位运算∙ ●C语言程序设计(高职高专)涉及知识:结构、数组、指针、标准输入输出5.考核内容●侧重考核考生的独立软件分析、设计、编码、调试等能力。
●题目形式为若干程序完善题及编程题。
没有选择、改错、问答等题型。
6.题目形式(1)程序完善题题目为若干具有一定难度梯度、分值不等的程序完善题。
要求对既定代码中的空缺部分进行补充完善,使整段代码完整。
(2)编程题题目为若干具有一定难度梯度、分值不等的编程题目。
这些题目的要求明确、答案客观。
要求考生通过编程的办法搜索题目的解。
一般难点集中于对算法的设计和逻辑的组织上。
理论上,考生不可能通过猜测或其它非编程的手段获得问题的解。
7.评分:主要以考生所的提交的程序的运行效果为依据进行评估。
同时也会参考考生程序的编码风格、逻辑性、可读性等方面。
NOIP2011普及组复赛试题+源程序

NOIP2011 普及组复赛1.数字反转(reverse.cpp/c/pas )【问题描述】给定一个整数,请将该数各个位上数字反转得到一个新数。
新数也应满足整数的常见形式,即除非给定的原数为零,否则反转后得到的新数的最高位数字不应为零。
(参见样例2)【输入】输入文件名为reverse.in。
输入共一行,一个整数N。
【输出】输出文件名为reverse.out。
输出共1行,一个整数,表示反转后的新数。
【输入输出样例1】据范围】-1,000,000,000WNW1,000,000,000。
【解题】这道题非常简单,可以读字符串处理,也可以读数字来处理,只不过要注意符号问题(以及~0,但测试数据没出)。
【法一】字符串处理Var i,l,k:integer;s:string;p:boolean;beginassign(input, 'reverse.in'); reset(input);assign(output, 'reverse.out'); rewrite(output);readln(s);l:=length(s);k:=1;if s[1]='-' thenbeginwrite('-');k:=2;end;p:=true;;for i:=l downto k dobeginif(p)and((s[i]='0')) then continue elsebegin write(s[i]); p:=false;;end;end;close(input); close(output);end.【法二】数字处理Var f:integer;n,ans:longint;begin assign(input, 'reverse.in'); reset(input);assign(output, 'reverse.out'); rewrite(output); readln(n);if n<0 then begin f:=-1; n:=-n;endelsef:=1;ans:=0;while n<>0 do beginans:=ans*10+n mod 10;n:=n div 10;end;ans:=ans*f;writeln(ans);close(input); close(output);end.2.统计单词数(stat.pas/c/cpp)【问题描述】一般的文本编辑器都有查找单词的功能,该功能可以快速定位特定单词在文章中的位置,有的还能统计出特定单词在文章中出现的次数。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
cout<<endl;
}
}
int main()
{
string pairs;
string str;
cin>>pairs>>str;
MakeSquare(pairs);
MakePassword(str);
}
}
int main()
{
int m;
int temprice;
cin>>m;
price.assign(m,0);
for(int temp=0;temp<m;temp++)
{
cin>>temprice;
//国信蓝点最后一道
//City of DLUT
//VinerL
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <sstream>
vector<int> temp;
for(int t=0;t<bo.size();t++)
{
temp.push_back(bo[t]);
}
final.push_back(temp);
}
if(i+2<str.length())
i=i+2;
else if(i+2>str.length())
{
password+=str[i+1];
i=i+2;
//国信蓝点杯倒数第2题.
//City of Dlut
//VinerL
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
using namespace std;
int current;
{
if(ch==keysquare[i][j])
{
return make_pair(i,j);
}
}
}
return make_pair(100,100);
for(int temp=0;temp<bo.size();temp++)
{
sum+=bo[temp]*price[temp];
}
if(sum==1000)
{
totalcount++;
int totalcount=0;
vector<int> price;
vector<vector<int> >final;
void Search(int i,int m,vector<int> bo,int now)
{
if(i>=m)
{
int sum=0;
{
keysquare[i/5][i-(i/5)*5]=pairs[i];
i++;
}
while(i<25)
{
bool con=0;
for(int temp=0;temp<pairs.length() ;temp++)
{
if(ch==pairs[temp])
{
ch++;
con=1;
}
}
if(con==1)
continue;
}
while(i<str.length())
{
temp=Search(str[i]);
x1=temp.first;
y1=temp.second;
temp=Search(str[i+1]);
x2=temp.first;
}
else
i=i+2;
}
}
void Show()
{
for(int i=0;i<5;i++)
{
for(int j=0;j<5;j++)
{
cout<<keysquare[i][j]<<" ";
y2=temp.second;
if(x1==100||x2==100)
{
password+=str[i];
password+=str[i+1];
}
else if(x1==x2||y1==y2)
{
password+=str[i+1];
password+=str[i];
}
else
{
password+=keysquare[x1][y2];
password+=keysquare[x2][y1];
price[temp]=temprice;
}
vector<int> bo(m,0);
Search(0,m,bo,0);
cout<<totalcount<<endl;
for(int i=0;i<totalcount;iassword(string str)
{
pair<int,int> temp;
int x1,x2,y1,y2;
int i=0;
if(str.length()==1)
{
password=str;
return;
for(int j=0;j<final[i].size();j++)
{
cout<<final[i][j]<<" ";
}
cout<<endl;
}
}
Show();
cout<<password;
}
keysquare[i/5][i-(i/5)*5]=ch;
i++;
ch++;
}
}
pair<int,int> Search(char ch)
{
for(int i=0;i<5;i++)
{
for(int j=0;j<5;j++)
using namespace std;
vector<string> keysquare(5,"abcde");
string password;
void MakeSquare(string pairs)
{
char ch='a';
int i=0;
while(i<pairs.size())
}
}
else
{
while(now<=1000)
{
Search(i+1,m,bo,now);
bo[i]++;
now+=price[i];
}