蓝桥杯2015第六届C语言真题汇总
蓝桥杯试题C语言答案
蓝桥杯试题C语言答案1、A、B、C、D、E五名学生有可能参加计算机竞赛,根据下列条件判断哪些人参加了竞赛:(1)A参加时,B也参加;(2)B和C只有一个人参加;(3)C和D或者都参加,或者都不参加;(4)D和E中至少有一个人参加;(5)如果E参加,那么A和D也都参加。
00110 c、d#include<stdio.h>int main(){int a,b,c,d,e; /*0表示不参加, 1表示参加.*/for(a=0;a<2;a++)for(b=0;b<2;b++)for(c=0;c<2;c++)for(d=0;d<2;d++)for(e=0;e<2;e++){if(a&&!b) continue;if(b&&c||!b&&!c) continue;if(c&&!d||!c&&d) continue;if(!d&&!e) continue;if(e&&(!a||!d)) continue;printf("%d%d%d%d%d",a,b,c,d,e);}return 0;}2、某侦察队接到一项紧急任务,要求在A、B、C、D、E、F六个队员中尽可能多地挑若干人,但有以下限制条件:1)A和B两人中至少去一人;2)A和D不能一起去;3)A、E和F三人中要派两人去;4)B和C都去或都不去;5)C和D两人中去一个;6)若D不去,则E也不去。
试编写一个程序,输出问应当让哪几个人去?#include<stdio.h>int main(){int a,b,c,d,e,f;for(a=1;a>=0;a--)for(b=1;b>=0;b--)/*1:去 0:不去*/for(c=1;c>=0;c--)for(d=1;d>=0;d--)for(e=1;e>=0;e--)for(f=1;f>=0;f--){if(a+b>=1&&a+d!=2&&a+e+f==2&&b==c&&c+d==1&&(d+e==0||d==1))printf("a=%d,b=%d,c=%d,d=%d,e=%d,f=%d",a,b,c,d,e,f);}return 0;}3、警察局抓住了A、B、C、D四名盗窃嫌疑犯,其中只有一人是小偷。
C程序设计第六届竞赛试题1
第六届c程序设计竞赛试题试题一素数问题走进世博园某信息通信馆,参观者将获得前所未有的尖端互动体验,一场充满创想和喜悦的信息通信互动体验秀将以全新形式呈现,从观众踏入展馆的第一步起,就将与手持终端密不可分,人类未来梦想的惊喜从参观者的掌上展开。
在等候区的梦想花园中,参观者便开始了他们奇妙的体验之旅,等待中的游客可利用手机等终端参加互动小游戏,与梦想剧场内的虚拟人物Kr Kong进行猜数比赛。
当屏幕出现一个整数x时,若你能比Kr Kong更快的发出最接近它的素数答案,你将会获得一个意想不到的礼物。
例如:当屏幕出现22时,你的回答应该是23;当屏幕出现8时,你的回答应是7;若x本身是素数,则回答x;若接近x的素数有两个时,则回答大于它的素数。
标准输入第一行:N 要竞猜的整数个数接下来有N行,每行只有一个正整数x标准输出输出有N行,每行是对应x的最接近它的素数。
约束条件1<=N<=5 1<=x<=1000样例输入382325样例输出72323#include<stdio.h>#include<math.h>void main(){int prime(int m);int N,i,a[5];int compare1,compare2;while(N<1||N>5){scanf("%d",&N);if(N<1||N>5)printf("输入有误请重新输入:\n"); }for(i=0;i<N;i++){scanf("%d",&a[i]);}printf("\n");for(i=0;i<N;i++){if(prime(a[i]))printf("%d\n",a[i]);else{compare1=a[i];compare2=a[i];while(1){compare1=compare1+1;if(prime(compare1))break;}while(1){compare2=compare2-1;if(prime(compare2))break;}if(compare1-a[i]<a[i]-compare2)printf("%d\n",compare1);else if(compare1-a[i]>a[i]-compare2)printf("%d\n",compare2);else if(compare1-a[i]==a[i]-compare2)printf("%d\n",compare1);elseprintf("error!\n");}}printf("\n");}int prime(int m){int i,n;if(m==1)return 0;n=sqrt(m);for(i=2;i<=n;i++)if(m%i==0){return 0;}return 1;}试题二救灾投放物质问题灾区已经非常困难,灾民需要帐篷、衣物、食品和血浆。
2015蓝桥杯c语言试题及答案
2015蓝桥杯c语言试题及答案2015蓝桥杯C语言试题及答案1. 以下哪个选项是C语言中合法的标识符?A. 2variableB. variable2C. intD. _int答案:B,D2. C语言中,以下哪个关键字用于定义一个结构体?A. structB. unionC. enumD. typedef答案:A3. 以下哪个选项不是C语言中的控制语句?A. ifB. whileC. switchD. case答案:D4. 在C语言中,以下哪个函数用于计算字符串的长度?A. strlen()B. strcpy()C. strcat()D. strcmp()答案:A5. 下列关于C语言中数组的描述,错误的是:A. 数组可以存储相同类型的多个元素B. 数组的大小在编译时确定C. 数组的索引从0开始D. 数组的索引可以是负数答案:D6. C语言中,以下哪个选项表示逻辑与运算?A. &&B. ||C. !D. ^答案:A7. 在C语言中,以下哪个函数用于将一个字符串复制到另一个字符串?A. strcat()B. strcpy()C. strcmp()D. strlen()答案:B8. C语言中,以下哪个关键字用于定义一个函数?A. intB. voidC. functionD. return答案:B9. 在C语言中,以下哪个选项表示全局变量?A. staticB. externC. autoD. register答案:B10. 在C语言中,以下哪个选项用于定义一个指针?A. int *p;B. int p[];C. int p[10];D. int p=10;答案:A11. 在C语言中,以下哪个选项表示无符号整型?A. intB. unsigned intC. longD. float答案:B12. 在C语言中,以下哪个函数用于将一个浮点数转换为字符串?A. sprintf()B. sscanf()C. strcat()D. strcmp()答案:A13. 在C语言中,以下哪个选项表示一个函数的返回类型为无返回值?A. intB. voidC. charD. float答案:B14. 在C语言中,以下哪个选项表示一个函数的返回类型为字符型?A. intB. voidC. charD. float答案:C15. 在C语言中,以下哪个关键字用于定义一个宏?A. defineB. macroC. constantD. include答案:A。
2015年蓝桥杯javac组第二题
题目:2015年蓝桥杯javac组第二题内容要点:1. 题目描述:给定一个字符串,要求在字符串中找出最长的连续不重复子串,并返回它的长度。
2. 输入:一个字符串,长度不超过xxx。
3. 输出:一个整数,表示最长的连续不重复子串的长度。
4. 例子:输入 "abcabcbb",输出 3;输入 "bbbbb",输出 1;输入"pwwkew",输出 3。
5. 解题思路:采用滑动窗口的方法,遍历字符串的过程中,维护一个窗口,通过移动窗口的起始位置和结束位置来寻找最长的连续不重复子串。
6. 算法步骤:6.1 初始化最长长度maxLength为0,起始位置start为0,字符索引字典charIndexDict为空。
6.2 遍历字符串,对于每个字符:6.2.1 如果字符在字典中存在且索引大于等于start,则将start移动到当前字符索引的下一个位置。
6.2.2 计算最长长度maxLength和当前窗口长度的较大值。
6.2.3 将当前字符的索引存入字典中。
7. 代码实现:```javapublic class Solution {public int lengthOfLongestSubstring(String s) {int maxLength = 0;int start = 0;Map<Character, Integer> charIndexMap = new HashMap<>();for (int end = 0; end < s.length(); end++) {char c = s.charAt(end);if (charIndexMap.cont本人nsKey(c) charIndexMap.get(c) >= start) {start = charIndexMap.get(c) + 1;}maxLength = Math.max(maxLength, end - start + 1); charIndexMap.put(c, end);}return maxLength;}}```文章结构:1. 概述:介绍2015年蓝桥杯javac组第二题的题目描述。
蓝桥杯大题总结(历届比赛共40多大题)
常用算法题目1.算法是这样的,如果给定N个不同字符,将这N个字符全排列,最终的结果将会是N!种。
如:给定A、B、C三个不同的字符,则结果为:ABC、ACB、BAC、BCA、CAB、CBA一共3!=3*2=6种情况。
public class AllPermutation{public static void main(String[] args){//使用递归完成全排列char[] source=new char[]{'A','B','C'};char[] result=new char[source.length];allPermutation(0,source,result);}/**** @param index当前考虑的数的下标(从0开始)* @param source* @param result*/public static void allPermutation(int index,char[] source,char[] result){//当源数据中只有一个字符时,将该字符加入结果数组,并输出if(source.length==1){result[index]=source[0];show(result);return ;}for(int i=0;i<result.length-index;i++){result[index]=source[i];char[] newSource=getNewSource(source,source[i]);allPermutation(index+1, newSource,result);}}public static void show(char[] result){System.out.println(result);}/*** 生成去掉指定字符的新源数据数组* @param source 原来的源数据数组* @param c 指定去掉的字符* @return*/public static char[] getNewSource(char[] source,char c){ char[] newSource=new char[source.length-1];for(int i=0,j=0;i<source.length;i++){if(source[i]!=c){newSource[j]=source[i];j++;}}return newSource;}}2.串的简单处理串的处理在实际的开发工作中,对字符串的处理是最常见的编程任务。
2015年蓝桥杯C组试题及答案
2014年蓝桥杯c语言试题及答案发布时间:2015-04-091. 标题: 马虎的算式小明是个急性子,上小学的时候经常把老师写在黑板上的题目抄错了。
有一次,老师出的题目是:36 x 495 = ?他却给抄成了:396 x 45 = ?但结果却很戏剧性,他的答案竟然是对的!!因为 36 * 495 = 396 * 45 = 17820类似这样的巧合情况可能还有很多,比如:27 * 594 = 297 * 54假设 a b c d e 代表1~9不同的5个数字(注意是各不相同的数字,且不含0)能满足形如: ab * cde = adb * ce 这样的算式一共有多少种呢?请你利用计算机的优势寻找所有的可能,并回答不同算式的种类数。
满足乘法交换律的算式计为不同的种类,所以答案肯定是个偶数。
答案直接通过浏览器提交。
注意:只提交一个表示最终统计种类数的数字,不要提交解答过程或其它多余的内容。
答案:1422. 标题: 振兴中华小明参加了学校的趣味运动会,其中的一个项目是:跳格子。
地上画着一些格子,每个格子里写一个字,如下所示:(也可参见p1.jpg) 从我做起振我做起振兴做起振兴中起振兴中华比赛时,先站在左上角的写着“从”字的格子里,可以横向或纵向跳到相邻的格子里,但不能跳到对角的格子或其它位置。
一直要跳到“华”字结束。
要求跳过的路线刚好构成“从我做起振兴中华”这句话。
请你帮助小明算一算他一共有多少种可能的跳跃路线呢?答案是一个整数,请通过浏览器直接提交该数字。
答案:353. 题目标题: 猜年龄美国数学家维纳(N.Wiener)智力早熟,11岁就上了大学。
他曾在1935~1936年应邀来中国清华大学讲学。
一次,他参加某个重要会议,年轻的脸孔引人注目。
于是有人询问他的年龄,他回答说:“我年龄的立方是个4位数。
我年龄的4次方是个6位数。
这10个数字正好包含了从0到9这10个数字,每个都恰好出现1次。
”请你推算一下,他当时到底有多年轻。
蓝桥杯试题C语言答案
1、A、B、C、D、E五名学生有可能参加计算机竞赛,根据下列条件判断哪些人参加了竞赛:(1)A参加时,B也参加;(2)B和C只有一个人参加;(3)C和D或者都参加,或者都不参加;(4)D和E中至少有一个人参加;(5)如果E参加,那么A和D也都参加。
00110 c、d#include<stdio.h>int main(){int a,b,c,d,e; /*0表示不参加, 1表示参加.*/for(a=0;a<2;a++)for(b=0;b<2;b++)for(c=0;c<2;c++)for(d=0;d<2;d++)for(e=0;e<2;e++){if(a&&!b) continue;if(b&&c||!b&&!c) continue;if(c&&!d||!c&&d) continue;if(!d&&!e) continue;if(e&&(!a||!d)) continue;printf("%d%d%d%d%d",a,b,c,d,e);}return 0;}2、某侦察队接到一项紧急任务,要求在A、B、C、D、E、F六个队员中尽可能多地挑若干人,但有以下限制条件:1)A和B两人中至少去一人;2)A和D不能一起去;3)A、E和F三人中要派两人去;4)B和C都去或都不去;5)C和D两人中去一个;6)若D不去,则E也不去。
试编写一个程序,输出问应当让哪几个人去?#include<stdio.h>int main(){int a,b,c,d,e,f;for(a=1;a>=0;a--)for(b=1;b>=0;b--)/*1:去 0:不去*/for(c=1;c>=0;c--)for(d=1;d>=0;d--)for(e=1;e>=0;e--)for(f=1;f>=0;f--){if(a+b>=1&&a+d!=2&&a+e+f==2&&b==c&&c+d==1&&(d+e==0||d==1))printf("a=%d,b=%d,c=%d,d=%d,e=%d,f=%d",a,b,c,d,e,f);}return 0;}3、警察局抓住了A、B、C、D四名盗窃嫌疑犯,其中只有一人是小偷。
2015年第六届蓝桥杯软件类省赛真题_C大学C组
for(i=0; i<N; i++){
a[i][0] = 1;
a[i][i] = 1;
}
for(i=1; i<N; i++){
for(j=1; j<i; j++) ___________________________;
}
for(i=0; i<N; i++){
1/2 1/3 1/10 1/15
1/2 1/4 1/5 1/20
1/2 1/4 1/6 1/12
再例如,
输入:
5
程序应该输出:
1/2 1/3 1/12 1/21 1/28
1/2 1/4 1/6 1/21 1/28
1/2 1/4 1/7 1/14 1/28
1/2 1/4 1/8 1/12 1/24
1/2 1/4 1/9 1/12 1/18
for(j=0; j<=i; j++) printf("%-5d", a[i][j]);
printf("\n");
}
return 0;
}
C大学C组
2_题目
1/1 + 1/2 + 1/3 + 1/4 + ... 在数学上称为调和级数。
它是发散的,也就是说,只要加上足够多的项,就可以得到任意大的数字。
但是,它发散的很慢:
前1项和达到 1.0
前4项和才超过 2.0
前83项的和才超过 5.0
那么,请你计算一下,要加多少项,才能使得和达到或超过 15.0 呢?
请填写这个整数。
注意:只需要填写一个整数,不要填写任何多余的内容。比如说明文字。
蓝桥杯刷题--第六届蓝桥杯
蓝桥杯刷题--第六届蓝桥杯题头:本内容所有题⾯都来⾃博客:https:///ryo_218/article/details/79704030在此感谢!1,奖券数⽬有些⼈很迷信数字,⽐如带“4”的数字,认为和“死”谐⾳,就觉得不吉利。
虽然这些说法纯属⽆稽之谈,但有时还要迎合⼤众的需求。
某抽奖活动的奖券号码是5位数(10000-99999),要求其中不要出现带“4”的号码,主办单位请你计算⼀下,如果任何两张奖券不重号,最多可发出奖券多少张。
思路:5重循环,搞定。
#include <iostream>#include <cstdio>using namespace std;int main(){int ans = 0;for(int a = 1; a <= 9; ++a)for(int b = 0; b <= 9; ++b)for(int c = 0; c <= 9; ++c)for(int d = 0; d <= 9; ++d)for(int e = 0; e <= 9; ++e){if(a != 4 && b != 4 && c != 4 && d != 4 && e != 4){ans++;}}printf("%d\n", ans);}View Code2、星系炸弹在X星系的⼴袤空间中漂浮着许多X星⼈造“炸弹”,⽤来作为宇宙中的路标。
每个炸弹都可以设定多少天之后爆炸。
⽐如:阿尔法炸弹2015年1⽉1⽇放置,定时为15天,则它在2015年1⽉16⽇爆炸。
有⼀个贝塔炸弹,2014年11⽉9⽇放置,定时为1000天,请你计算它爆炸的准确⽇期。
请填写该⽇期,格式为 yyyy-mm-dd 即4位年份2位⽉份2位⽇期。
⽐如:2015-02-19请严格按照格式书写。
不能出现其它⽂字或符号。
2015年大学生英语竞赛C类真题
2015年全国大学生英语竞赛初赛C级真题Part I Listening (30 marks)1。
What does the conversation imply?A. Great minds think alike。
B. You are what you wear。
C。
A contented mind is a perpetual feast.D。
Actions speak louder than words.2。
How does the man identify a disease gene?A. He uses a special instrument.B。
He analyses the gene carefully。
C. He bases his finding on his previous research.D. He sends the results of his analysis to biologists for confirmation。
3. Why is the man planning to fly to Singapore?A. The weather there is quite nice for a holiday。
B. He wants to watch a basketball match to be held there。
C. NBA tickets there are much cheaper than those in New York。
D。
Air tickets from the USA to Singapore are cheap now。
4。
What is the ma’s opinion of seeing movies in a theatre?A. He doesn't like the big screen in the theatre。
2015年全国大学生英语竞赛C类真题、答案及评分标准
2015年全国大学生英语竞赛初赛C级真题Part I Listening (30 marks)1. What does the conversation imply?A. Great minds think alike.B. You are what you wear.C. A contented mind is a perpetual feast.D. Actions speak louder than words.2. How does the man identify a disease gene?A. He uses a special instrument.B. He analyses the gene carefully.C. He bases his finding on his previous research.D. He sends the results of his analysis to biologists for confirmation.3. Why is the man planning to fly to Singapore?A. The weather there is quite nice for a holiday.B. He wants to watch a basketball match to be held there.C. NBA tickets there are much cheaper than those in New York.D. Air tickets from the USA to Singapore are cheap now.4. What is the man’s opinion of seeing movies in a theatre?A. He doesn’t like the big screen in the theatre. B It is not as comfortable as seeing movies at home.C. It is much more expensive than seeing movies at home.D. He thinks travelling a long way to the theatre is a waste of time.5. What are the speakers talking about?A. Importance of saving water.B. Ways to improve farming.C. The city’s nasty weather.D. Water shortage in the city.Section B (10 marks) Long ConversationsConversation one6.What does the man want tickets for?A. For a May Flower choir performance.B. For an opera performance.C. For the Mozart Piano Concerto.D. For the Beethoven Symphony7.When will he attend the performance?A. On Sunday, May 21.B. On Monday, May 22.C. On Thursday, May 25D. On Sunday, May 268.What kind of music dose the man like?A. Piano concerto.B. Rhythm &Blues(R&B).C. Jazz.D. Symphony.9.What is the man’s telephone number?A.648 7967B.647 7968C.646 7988D.649 794810.When is the man expected to pick up his tickets?A. Before 7:30 on the night of the performance.B. Any time on the day of the performance.C. Between 7:30 and 8:00 any night.D. Any time before the performance.Conversation Two11.What are the two kinds of people mentioned in the quote of Marlo’s father?A. The rich and the poor.B. Givers and takers.C. Eaters and sleepers.D. The old and young.12.Why is the St.Jude Hospital special?A. It serves children from certain communities only.B. It was founded by some big companies .C. It collects donations for sick children.D. It provides excellent service for patients.13. What is the motto of the Thanks & Giving Campaign?A. Give thanks to both sick and healthy kids.B. Cherish the traditional holidays.C. Honour the donating companies.D. Give money to people in need.14. What does Marlo remind people to do when they are in a happy mood?A. Always help those who are in need on the streets.B. Stop purchasing and save money for the future.C. Think of the families who are fighting for their child’s life.D. Look after old parents and young children in the family.15. What do some big companies cooperate with St. Jude Hospital?A. They donate large amounts of money to the hospital.B. They send sick employees to the hospital for treatment.C. They promote the Thanks & Giving Campaign regularly.D. They collect donations and send them to the hospital. Section C (5 marks)16. Why was scientific satellite MAVEN sent to space?A. To find out if there are any living creatures or plants on Mars.B. To collect water samples from Mars and learn what is happening on Mars.C. To learn what happened to the atmosphere and water on Mars.D. To study the geological and geographical conditions on Mars.17. What is scientists’ latest research on robots?A. Robots that can run quickly on four legs.B. Robots that can carry heavy loads as pack animals do.C. Robots that are less expensive to build.D. Robots that can operate on batteries.18. What is the Scholastic Aptitude Test (SAT) accused of?A. Its influence on U.S. movies and TV shows.B. Its attempt to spread American culture.C. Its tough demands on overseas students.D. Its exclusion of American values.19. What does Ritu Sharma want to show in her book Teach a Woman to Fish?A. How woman in poor conditions can break the cycle of poverty.B. Her extraordinary travel experience in four countries.C. The challenge and opportunities facing woman in Sri Lanka.D. Different ways of finishing that are suitable for women.20. What does ‘Black Friday’ in this conversion refer to?A. A special day in memory of people who died in a tragic stampede.B. A shopping discount service available only on Fridays.C. A new TV show to be held in New York and California.D. A big day in a holiday shopping season with lots of goods in discount.Section D There are 10 missing words or phrases. Fill in the blanks with exact words or phrases you hear.At movie preview, reporters are often searched before entering a theatre. If cameras or camcorders are found, security guards take them until the preview in finished. The guards do this because people might 21.___________ the movie before it is released. They are trying to protect the right of intellectual property (IP).Intellectual property is 22.__________ of intangible things likes music, film, computer programmes, techniques and books. Counties like United State have a strict system of patents, copyrights and trademark rights. When a person produces something new, they 23.___________ one of these from the government to prove he or she is the owner of the invention and that it is illegal for others to copy it. Patents are needed for new inventions. Copyright are used for materials like books, music, computer progammes and movies. Trademark rights are used for 24._________. You can tell if something is copyrighted or trademarked by looking on the package for a small encircled C or T respectively.As international trade increases, problems 25.___________ regarding IP . Some counties have less strict laws for IP than others. In counties like Vietnam, where laws for IP are not very strict, products 26.__________ other counties are often copied and sold for a cheaper price. For example, it is common to find copies of U.S. movies 27.___________ in these counties. The United States and other counties with strict IP laws want all counties to have strict IP laws so that 28.__________. So, they pressure other countries to strengthen IP laws. For example, before Vietnam could join the World Trade Organisation in 2006, they had to strengthen their IP laws.Not everyone believes that laws protecting IP 29._________.Some believe it is wrong for others to have a monopoly on an idea or invention that could serve the public good. For example, some poor countries have many people 30._______ diseases but do not have the infrastructure needed to produce drugs to help the patients . Other richer countries have produced the drugs but are selling them at too high a price for the poor countries to afford, which may cause people to die.Part II Vocabulary, Grammar & Culture (15 marks)Section A Vocabulary and Grammar (10 marks)31. Animals are one of the most important resources for human beings, however , by 2030 ,many species will have ______according to recent research .A. used upB. died outC. gone upD. got rid of32. If the government refused to appropriate funds, the slum-clearance programme might be ______.A. rejectedB. contendedC. abusedD. terminated33. We are in the full ______ that the current situation will improve sooner or later.A. understandingB. appreciationC. consciousnessD. conviction34. The reporters exposed the corruption of several high officials in the government; ______, they were asked to resign fromoffice .A. constantlyB. consistentlyC. consequentlyD. consecutively35. Helping his little daughter with her physics homework reminded him of things he had long ______.A. cared aboutB. forgotten aboutC. dreamed aboutD. complained about36. You should never provide your personal information ______ a request you did not ask for over the Internet .A. in response toB. according toC. prior toD. thanks to37. The new chairman urged the members of the committee to ______ their differences and settle down to work .A. wear outB. break upC. calm downD. set aside38.Why so many students graduate from high school with inadequate skills in reading andmathematics is a question that continues to ______American educators.A. harassB. intimidateC. troubleD. oppress39.— I need some help with my homework!—______ I’ve got lots of work to do myself, and besides, it’s your problem, not mine!A. No problems, just a moment!B. Sorry, I can’t help you right now.C. Yes, I need your help as well.D. Wait, it’s a piece of cake for me.40.—I spilled some coffee on my jacket! ______.—You’ll see a place on Madison Avenue between the First Street and the Second Street. It’s Beside the bank.A. How can you get it ironed?B. Do you know the way to the factory?C. Who is to blame for the accident?D. Where can I get it cleaned?Section B Culture (5 marks)41. ______ felt that society forced too many rules on people and kept them from living a full, natural life. His forceful writing on daring themes shocked many. Sons and Lovers, based partly on his own life, is one of his finest novels.A. James Joyce.B. D. H. Lawrence.C. George Bernard ShawD. Thomas Hardy.42. Which of the following is the national flag of the United States of America?43. Which of the following is the famous theory developed by Albert Einstein?A. The Theory of Mechanics.B. The Natural Selection.C. The Theory of Relativity.D. Quantum Gravity.44. Which country is famous for the statue of the Little Mermaid?A. Finland.B. Sweden.C. Denmark.D. Norway.45. ______ was an English comic actor and filmmaker who rose to fame in the silent film era.A. Marlon Brando.B. Charlie Chaplin.C. Steven Allan SpielbergD. Dustin Hoffman.Part Ⅲ Cloze(10 marks)Fill in each blank with one word. Choose the correct word in one of the following three ways: according to the context, by using the correct form of the given word, or by using the given letter(s) of the word.Is paragliding more dangerous than parachuting?There are three elements that support the argument that through46.________ of them is safe, one is far less dangerous than the other. Those three elements are training, preparation, and skill level.Training for the first parachute jump is a 47.rel ________ simple process. Commonly a morning of instruction and practice can result 48.________ a person’s first jump the same afternoon. In contrast, paragliding training is much more involved, taking anywhere from one to three months before the first flight occurs. It is 49.________ (legal) to fly without a license, and various competence levels must be passed to be able to move from soaring to something more involved such as cross-country flying.Preparation for a parachute jump is minimal 50.________ best. Most jumpers have their chutes packed for them, so all they have to do is climb into the plane. Some pack their own chutes, but still, this is minor. In paragliding the pilot lays out their canopy on the ground, checks it and the lines, and then must wait for the right wind conditions before launching. The fact that the chute and lines can be seen makes a 51.tre________ difference as any problems can be seen before launch, something thatis impossible with parachuting. This is a very important difference because almost all parachuting 52. acc________ are the result of equipment failure. Jumpers rely almost totally on their equipment and not their skill, the reverse of the paragliding pilot.It is this difference in skill levels that makes paragliding the safer option. The 53. ________ (great) the skill the pilot develops, the less chance they might get into a dangerous situation when flying. Also, if they do get into a dangerous situation, it is far more likely that they will be able to escape. With parachuting it is the 54. opp ________. Ultimately skill does not matter. Even the most experienced jumper will be 55. ________ (able) to do anything in the event of major equipment failure. Like Russian roulette, the question is how many times a person jumps before statistics catch up with them.Part IV Reading Comprehension (35 marks)Section A (5 marks) Questions 56-60 are based on the following passage.Hallward Library supports the learning, teaching and research needs of the Faculty of Arts and the Faculty of Social Sciences. This includes the subject areas of arts, humanities, law and social sciences, and a European Documentation Centre.You may be able to use our libraries for reference or borrowing through membership of the SCONUL Access scheme. Please apply to join the scheme online. You may also wish to complete our University of Nottingham registration from before you come. On arrival at one of our libraries, please go to the reception or lending desk with your SCONUL introductory email and library card from your home institution, where we will issue you a University of Nottingham library card with immediate borrowing rights (a photograph is not required). Please check our lending desk opening times.If your SCONUL Access membership entitles you to borrow, you may take up to six ordinary loan books for up to four weeks. Items from our Short Loan collection are not available to borrow under this scheme and there will be lead time in accessing items stored off site or at a different University of Nottingham library. Study rooms are left open for general use, but room keys cannot be borrowed by SCONUL Access users and room bookings cannot be made.Please also consult our information on how to access electronic resources and the Internet via the eduroam wireless service. If your institution is not a member of SCONUL Access you may use our libraries for reference during our libraries for referenceduring our vacations. Please ensure that you bring your library card or some other means of confirming your current student status.You are welcome to visit any of our libraries and use them for reference purposes. Please go to the reception or lending desk on arrival and bring identification with you.We are members of INSPIRE and welcome visitors referred from public libraries under this scheme.If you would like to borrow books then you can become an external borrower.We can arrange school visits through our service Step into University Libraries: Visits for Local Schools. In order to be able to offer schools a good experience, we would encourage arrangements to be made well in advance and for visits to be scheduled outside of University terms. Groups should be accompanied by leaders or teachers who will adhere to their responsibilities as detailed in Section 2 of the University’s Guidance on Arrangements for Protection of Children and Vulnerable Adults.Question 56-60 Decide the following statements are true (T) or false (F) according to the passage.56. The Hallward Library serves students in all majors of the University of Nottingham.57. Anyone who wants to borrow books through the SCONUL scheme must register online before they come to the reception of the library and get a library card.58. Through the SCONUL scheme no more than 6 ordinary loan books can be borrowed while none of Short Loan books can be borrowed.59. Electronic resources and Internet cannot be used in the library without permission.60. Visitors can come to the library for reference purposes and even borrow books.Section B (10 marks) Question 61-65 are based on the following passage.Tony Wheeler is the man behind the Lonely Planet guidebooks, books which are loved and hated in equal measure. It’s hard to pin down why they provoke such violent emotion; once it was simply because they lied—you don’t turn up for the weekly Wednesday ferry to find that actually it goes on Tuesdays. Nowadays they are carefully researched, the information is generally true, and the maps are accurate.(61) ______ Arrive in a place and out comes the book: Places to Stay, Things to See, Getting Around, Places to Eat—all of which is undeniably useful. But you end up living a life dictated by Wheeler, and that life might not be right for you. On top of that, everyone else has got one too, so instead of being the independent traveller you thought you were, you end up being just another tourist.(62) ______ His wife Maureen, who runs the company with him, is equally to blame. It all started in 1972 when, bored with Britain, they see off for Australia. They arrived in Sydney three months later with 27 cents between them. Tony sold his camera, then sat down and wrote about the trip. They put the pages together and took it around the local bookshops and one of the bookshops sold thousands of copies.(63) ______Their 200-odd guidebooks cover nearly everywhere and there are phrasebooks, atlases, walking guides. They sell more than three million books a year and employ around 200 people. The Lonely Planet website is visited a million times a day and the Wheelers have replaced the van with a red Ferrari.(64) ______ ‘My children have travelled all over the world so they’re aware of a lot of things,’ says Maureen and Tony agrees. ‘It helps you grow up a lot, just knowing how other people live and what happens in their countries. Secondly, being on your own, having to make your way from one place to the next and work out how you do that, gives you a self-sufficiency that I think is very important.’(65) ______There are people who say that by encouraging people to go places they’re destroying them-an accusation they both deny, claiming that people would go there anyway. They admit that none of this is bad for business, ‘All the publicity has sold o ur books.’Questions 61-65 Complete the article with the following sentences. There are two extra sentences that you do not need to use.A.Twenty-five years on, Lonely Planet has, quite literally, taken over the world.B.There has been controversy surrounding the guidebooks.C.Getting a guidebook like the Lonely Planet right can be a tricky business.D.No, it’s something about the way they take you over-you become a slave to the guidebook.E.Tony Wheel is still very actively involved in the Lonely Planet guidebooks.F.So what do they think about travel in general?G.It’s not entirely fair to blame only Tony.Section C (10marks) Questions 66-70 are based on the following passage.Situated at the heart of Beijing, the Palace Museum is approached through the Gate of Heaven ly Peace (Tian’an men). Because of its centrality as well as restricted access, the palace was called the Forbidden City, It was built from 1406 to 1420 by the third emperor of the Ming dynasty, the Yongle Emperor who, upon usurping the throne, determined to move his capital northward from Nanjing to Beijing. The Ming dynasty fell to the Manchu Qing in 1644 and in 1911 the Qing dynasty wasoverthrown by the republican revolutionaries. During nearly six hundred years, twenty-four emperors lived in and ruled from this palace.The Forbidden City is surrounded by 10-metre-high walls and a 52-meter-wide moat. Measuring 961 meters from north to south and 753 meters from east to west, it covers an area of 1110000 square meters. Each of the four sides is pierced by a gate: the Meridian Gate (Wu men) on the south, the Gate of Divine Prowess(Shenwu men) on the north, the Eastern and Western Prosperity Gates (Donghua men and Xihua men).Once inside, visitors will see a succession of halls and palaces spreading out on eit her side of an invisible central axis. The buildings’ glowing yellow roofs levitating above vermilion walls is a magnificent sight. The painted ridges and carved beams all contribute to the sumptuous effect.Known as the Outer Court, the southern portion of the Forbidden City centers on three main halls -- Hall of Supreme Harmony (Taihedian),Hall of Central Harmony (Zhonghedian),and Hall of Preserving Harmony (Baohedian). It was here in the Outer Court that the emperor held court and conducted grand audiences. Mirroring this arrangement is the Inner Court comprising the northern portion of the Forbidden City. The Inner Court is comprised of not only the residences of the emperor and his consorts but also venues for religious rituals and administrative activities.In total, the buildings of the two courts account for an area of some 163000 square meters. These were precisely designed in accordance with a code of architectural hierarchy, which designated specific features to reflect the paramount authority and status of the emperor. No ordinary mortal would have been allowed or would even have dared to come within close proximityto these buildings.The Forbidden City, the culmination of the two-thousand-year development of classical Chinese and East Asian architecture, has been influential in the subsequent development of Chinese architecture, as well as providing inspiration for many artistic works.Questions 66-7066. Why was the Palace given the name as “The Forbidden City”?67. Who was the first emperor that lived in the Palace?68. How long is the Forbidden City?69. What is the total area of the Forbidden City?70. What is the main function of the Inner Court of the Forbidden City?Section D (10 marks) Questions 71-75 are based on the following passage.A ncient Greeks thought the brain wasn’t the basis for intellect. It was the home for the soul. They believed that the process of thinking happened somewhere near lungs. The brain wasn’t seen as an organ of intellect and thought until the 17th and 18th centuries. In order to measure intelligence, the IQ test, or the intelligence quotient test, was invented. The Standford-Binet Intelligence Scale was created in Paris in the early 1900s. The scale was used in Alfred Binet’s efforts to educate children with learning difficulties. Those with scores less than their respective ages were considered mentally challenged. The MENSA IQ test has also become popular. A person who scores 150 or higher on this test is considered to have exceptional intelligence. More than 10,000 people take the test every year.Some see IQ tests as an assessment of an individual’s problem-solving skills, rather than general intelligence. For example, an individual may have high analytical intelligence that is genetic. This widely held view promoted many prejudiced ideas. Since the IQ test was created from the point of view of Europeans, people of other races scored comparatively lower. Research suggests that intelligence depends on culture and class. Tests given by the U.S. military showed that blacks scored lower than whites. The difference in scores was attributed to class and education levels, not genetic factors. Black children adopted into wealthier families scored significantly higher than low-income blacks. Studies have shown that children who grow in a positive learning environment score higher on the IQ tests. Having good nutrition can also affect the scores.A new type of IQ test has surfaced later on. It's called the EI test, or the emotional intelligence test. The test gauges theind ividual’s ability to manage his or her emotions. Developed by Daniel Goleman, the test also measures how much self-awareness an individual has. Knowledge and emotional intelligence are different, experts say. A person with high emotional intelligence is able to better understand the feelings of others. Thus, they are better maintaining various relationships. Low emotional intelligence can affect intelligence. Studies have shown that emotional intelligence is connected with memory and concentration. Individuals with low emotional intelligence have more aggressiveness and less self-control. These factors can dramatically reduce IQ scores by as much as 25 percent.Questions 71-75 Complete the summary with only one word for each blank from the passage, changing the form where necessary.Since the early 1900s, scientists have attempted to gauge the intelligence of people. Alfred Binet’s intelligence scale and the MENS IQ test have been used frequently over the past centuries in 71.________ intelligence. Some studies suggest that the tests aren’t necessarily a flawless benchmark, arguing that it 72._______ only a person’s problem-solving skills. Others think that intelligence is 73._______ and it varies among races. New findings point to culture, class, education levels and environment as more important intelligence predictors 74._______ genetics. A new test that measures the emotional intelligence, the ability to monitor one’s emotions, has emerged. Recent findings reveal that one’s emotional intelligence can affec t one’s IQ test 75._______.Part V Translation (15 marks)Section A (5 marks) Translate the following paragraph into Chinese.76. Opera is an art that brings music, singing, and drama together on stage. The first operas were performed in Italy in the early 1600s. These operas were based on ancient Greek myths and accompanied by simple melodies. The early composers of opera called their work “drama through music” because they felt the music was the key to expressing an idea or emotion. Although the first operas were performed for the aristocracy, by the 1700s many operas were being performed for the public.Section B (10 marks) Translate the following sentences into English by using the hints given in brackets.77. 他在学校的表现还没有达到他父母的期望。
蓝桥杯试题答案(C语言)
1、亲密数:假设有a、b两个数,若a的所有因子之和等于b,b的所有因子之和等于a,并且a不等于b,则称a和b是一对亲密数。
如284和220就是一对亲密数。
#include<stdio.h>int main(){int a,b,i,n;for(a=1;a<=10000;a++){for(b=0,i=1;i<=a/2;i++)if(a%i==0)b+=i;for(n=0,i=1;i<=b/2;i++)if(b%i==0)n+=i;if(n==a&&a!=b&&a<b)printf("%d-%d\n",a,b);}return0;}2、世纪末的星期:曾有邪教称1999年12月31日是世界末日。
当然该谣言已经不攻自破。
还有人称今后的某个世纪末的12月31日䊵如果是星期一则会....有趣的是任何一个世纪末的年份的12月31日都不可能是星期一!!于是“谣言制造商”又修改为星期日......1999年的12月31日是星期五,请问,未来哪一个离我们最近的一个世纪末年即xx99年的12月31日正好是星期天,即星期日请回答该年份,只写这个4位整数,不要写12月31等多余信息#include<stdio.h>int main(){long days=5;/*1999年的最后一天为周5,把下一年加上5天对7取余为0的,则是周日*/int i=2000;for(;;)/*无循环终止条件,可以利用break语句终止循环*/{if(i%4==0&&i%100!=0||i%400==0){days=days%7+366;}else{days=days%7+365;}if(days%7==0&&i%100==99){printf("%d",i);break;}i++;}return0;}3、马虎的算式:小明是个急性子,上小学的时候经常把老师写在黑板上的题目抄错了。
蓝桥杯c语言试题及答案预赛
蓝桥杯c语言试题及答案预赛蓝桥杯C语言试题及答案预赛1. 题目一:计算阶乘要求:编写一个程序,计算并输出任意正整数的阶乘。
答案:```c#include <stdio.h>long long factorial(int n) {if (n == 0) return 1;long long result = 1;for (int i = 1; i <= n; i++) {result *= i;}return result;}int main() {int number;printf("请输入一个正整数:");scanf("%d", &number);printf("%d的阶乘是:%lld\n", number, factorial(number));return 0;}```2. 题目二:寻找最大值要求:给定一个整数数组,找出数组中的最大值。
答案:```c#include <stdio.h>int findMax(int arr[], int size) {int max = arr[0];for (int i = 1; i < size; i++) {if (arr[i] > max) {max = arr[i];}}return max;}int main() {int arr[] = {3, 5, 2, 7, 1};int size = sizeof(arr) / sizeof(arr[0]);printf("数组中的最大值是:%d\n", findMax(arr, size)); return 0;}```3. 题目三:字符串反转要求:编写一个程序,实现字符串的反转。
答案:```c#include <stdio.h>#include <string.h>void reverseString(char str[]) {int length = strlen(str);for (int i = 0; i < length / 2; i++) {char temp = str[i];str[i] = str[length - i - 1];str[length - i - 1] = temp;}}int main() {char str[] = "Hello, World!";reverseString(str);printf("反转后的字符串是:%s\n", str);return 0;}```4. 题目四:斐波那契数列要求:编写一个程序,输出斐波那契数列的前N项。
蓝桥杯2015省赛c语言试题及答案
蓝桥杯2015省赛c语言试题及答案蓝桥杯2015省赛C语言试题及答案一、选择题(每题2分,共20分)1. 下列关于C语言中变量的描述,错误的是:A. 变量必须先定义后使用B. 变量的类型必须一致C. 变量的命名只能使用英文字母D. 变量的命名可以包含下划线答案:C2. 在C语言中,以下哪个选项是合法的整型常量?A. 0x1AB. 1.23C. 0123D. E12答案:A3. 关于C语言中的数组,以下说法正确的是:A. 数组的大小在声明时必须确定B. 数组的大小可以在运行时确定C. 数组的下标可以是负数D. 数组的下标可以是小数答案:A4. 下列哪个关键字用于定义C语言中的函数?A. defineB. functionC. intD. void答案:C5. 在C语言中,下列哪个选项是正确的字符串声明?A. char str[10] = "Hello, World!";B. char str[] = "Hello, World!";C. char str[20] = "Hello, World!";D. char str = "Hello, World!";答案:B二、填空题(每题2分,共20分)1. 在C语言中,使用________关键字来定义一个函数。
答案:int2. 以下代码段的输出结果是________。
```c#include <stdio.h>int main() {int a = 10;printf("%d", a++);return 0;}```答案:103. C语言中,________运算符用于计算两个数的和。
答案:+4. 如果一个变量x的值为5,那么表达式x++的结果为________。
答案:65. 在C语言中,使用________关键字来定义一个全局变量。
答案:extern三、编程题(共60分)1. 编写一个C语言程序,计算并输出100以内所有偶数的和。
蓝桥杯试题C语言答案
1、A、B、C、D、E五名学生有可能参加计算机竞赛,根据下列条件判断哪些人参加了竞赛:(1)A参加时,B也参加;(2)B和C只有一个人参加;(3)C和D或者都参加,或者都不参加;(4)D和E中至少有一个人参加;(5)如果E参加,那么A和D也都参加。
00110 c、d#include<stdio.h>int main(){int a,b,c,d,e; /*0表示不参加, 1表示参加.*/for(a=0;a<2;a++)for(b=0;b<2;b++)for(c=0;c<2;c++)for(d=0;d<2;d++)for(e=0;e<2;e++){if(a&&!b) continue;if(b&&c||!b&&!c) continue;if(c&&!d||!c&&d) continue;if(!d&&!e) continue;if(e&&(!a||!d)) continue;printf("%d%d%d%d%d",a,b,c,d,e);}return 0;}2、某侦察队接到一项紧急任务,要求在A、B、C、D、E、F六个队员中尽可能多地挑若干人,但有以下限制条件:1)A和B两人中至少去一人;2)A和D不能一起去;3)A、E和F三人中要派两人去;4)B和C都去或都不去;5)C和D两人中去一个;6)若D不去,则E也不去。
试编写一个程序,输出问应当让哪几个人去?#include<stdio.h>int main(){int a,b,c,d,e,f;for(a=1;a>=0;a--)for(b=1;b>=0;b--)/*1:去 0:不去*/for(c=1;c>=0;c--)for(d=1;d>=0;d--)for(e=1;e>=0;e--)for(f=1;f>=0;f--){if(a+b>=1&&a+d!=2&&a+e+f==2&&b==c&&c+d==1&&(d+e==0||d==1))printf("a=%d,b=%d,c=%d,d=%d,e=%d,f=%d",a,b,c,d,e,f);}return 0;}3、警察局抓住了A、B、C、D四名盗窃嫌疑犯,其中只有一人是小偷。
第六届蓝桥杯JavaC组省赛真题——详细答案对照(包含垒骰子)
第六届蓝桥杯JavaC组省赛真题——详细答案对照(包含垒骰⼦)A、隔⾏变⾊Excel表的格⼦很多,为了避免把某⾏的数据和相邻⾏混淆,可以采⽤隔⾏变⾊的样式。
⼩明设计的样式为:第1⾏蓝⾊,第2⾏⽩⾊,第3⾏蓝⾊,第4⾏⽩⾊,....现在⼩明想知道,从第21⾏到第50⾏⼀共包含了多少个蓝⾊的⾏。
请你直接提交这个整数,千万不要填写任何多余的内容。
题解:package demo;public class demo {public static void main(String[] args) {int color = 0;for (int i = 21; i <= 50; i++) {if (i % 2 != 0) {color++;}}System.out.println(color);}}B、⽴⽅尾不变有些数字的⽴⽅的末尾正好是该数字本⾝。
⽐如:1,4,5,6,9,24,25,....请你计算⼀下,在10000以内的数字中(指该数字,并⾮它⽴⽅后的数值),符合这个特征的正整数⼀共有多少个。
请提交该整数,不要填写任何多余的内容。
题解:int count = 0;for (int i = 1; i <= 10000; i++) {String x = i + "";String cudb = cudb(i) + "";// 切割⽴⽅数最后相应⼏位String y = cudb.substring(cudb.length() - x.length());// 判断是否相同if (y.equals(x)) {count++;}}System.out.println(count);}/*** @param x* @return*/public static long cudb(int x) {return (long)Math.pow(x, 3);}}C、⽆穷分数⽆穷的分数,有时会趋向于固定的数字。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1、奖券数目有些人很迷信数字,比如带“4”的数字,认为和“死”谐音,就觉得不吉利。
虽然这些说法纯属无稽之谈,但有时还要迎合大众的需求。
某抽奖活动的奖券号码是5位数(10000-99999),要求其中不要出现带“4”的号码,主办单位请你计算一下,如果任何两张奖券不重号,最多可发出奖券多少张。
请提交该数字(一个整数),不要写任何多余的内容或说明性文字。
2、星系炸弹在X星系的广袤空间中漂浮着许多X星人造“炸弹”,用来作为宇宙中的路标。
每个炸弹都可以设定多少天之后爆炸。
比如:阿尔法炸弹2015年1月1日放置,定时为15天,则它在2015年1月16日爆炸。
有一个贝塔炸弹,2014年11月9日放置,定时为1000天,请你计算它爆炸的准确日期。
请填写该日期,格式为yyyy-mm-dd 即4位年份2位月份2位日期。
比如:2015-02-19 请严格按照格式书写。
不能出现其它文字或符号。
if(year%4==0||(year%100==0&&year%400!= 0))3、三羊献瑞观察下面的加法算式:祥瑞生辉+ 三羊献瑞-------------------三羊生瑞气(如果有对齐问题,可以参看【图1.jpg】)其中,相同的汉字代表相同的数字,不同的汉字代表不同的数字。
请你填写“三羊献瑞”所代表的4位数字(答案唯一),不要填写任何多余内容。
4、格子中输出StringInGrid函数会在一个指定大小的格子中打印指定的字符串。
要求字符串在水平、垂直两个方向上都居中。
如果字符串太长,就截断。
如果不能恰好居中,可以稍稍偏左或者偏上一点。
下面的程序实现这个逻辑,请填写划线部分缺少的代码。
#include <stdio.h>#include <string.h>void StringInGrid(int width, int height, const char* s){int i,k;char buf[1000];strcpy(buf, s);if(strlen(s)>width-2) buf[width-2]=0;printf("+");for(i=0;i<width-2;i++) printf("-");printf("+\n");for(k=1; k<(height-1)/2;k++){printf("|");for(i=0;i<width-2;i++) printf(" ");printf("|\n");}printf("|");printf("%*s%s%*s",___________________ __________________________); //填空printf("|\n");for(k=(height-1)/2+1; k<height-1; k++){printf("|");for(i=0;i<width-2;i++) printf(" ");printf("|\n");}printf("+");for(i=0;i<width-2;i++) printf("-");printf("+\n");}int main(){StringInGrid(20,6,"abcd1234");return 0;}对于题目中数据,应该输出:+------------------+| || abcd1234 || || |+------------------+(如果出现对齐问题,参看【图1.jpg】)注意:只填写缺少的内容,不要书写任何题面已有代码或说明性文字。
5、九数组分数1,2,3...9 这九个数字组成一个分数,其值恰好为1/3,如何组法?下面的程序实现了该功能,请填写划线部分缺失的代码。
#include <stdio.h>void test(int x[]){int a = x[0]*1000 + x[1]*100 + x[2]*10 + x[3];int b = x[4]*10000 + x[5]*1000 + x[6]*100+ x[7]*10 + x[8];if(a*3==b) printf("%d / %d\n", a, b);}void f(int x[], int k){int i,t;if(k>=9){test(x);return;}for(i=k; i<9; i++){{t=x[k]; x[k]=x[i]; x[i]=t;}f(x,k+1);___________________________________ __________ // 填空处}}int main(){int x[] = {1,2,3,4,5,6,7,8,9};f(x,0);return 0;}注意:只填写缺少的内容,不要书写任何题面已有代码或说明性文字。
6、加法变乘法我们都知道:1+2+3+ ... + 49 = 1225现在要求你把其中两个不相邻的加号变成乘号,使得结果为2015比如:1+2+3+...+10*11+12+...+27*28+29+...+49 = 2015就是符合要求的答案。
请你寻找另外一个可能的答案,并把位置靠前的那个乘号左边的数字提交(对于示例,就是提交10)。
注意:需要你提交的是一个整数,不要填写任何多余的内容。
7、牌型种数小明被劫持到X赌城,被迫与其他3人玩牌。
一副扑克牌(去掉大小王牌,共52张),均匀发给4个人,每个人13张。
这时,小明脑子里突然冒出一个问题:如果不考虑花色,只考虑点数,也不考虑自己得到的牌的先后顺序,自己手里能拿到的初始牌型组合一共有多少种呢?请填写该整数,不要填写任何多余的内容或说明文字。
8、移动距离X星球居民小区的楼房全是一样的,并且按矩阵样式排列。
其楼房的编号为1,2,3...当排满一行时,从下一行相邻的楼往反方向排号。
比如:当小区排号宽度为6时,开始情形如下:1 2 3 4 5 612 11 10 9 8 713 14 15 .....我们的问题是:已知了两个楼号m和n,需要求出它们之间的最短移动距离(不能斜线方向移动)输入为3个整数w m n,空格分开,都在1到10000范围内w为排号宽度,m,n为待计算的楼号。
要求输出一个整数,表示m n 两楼间最短移动距离。
例如:用户输入:6 8 2则,程序应该输出:4再例如:用户输入:4 7 20则,程序应该输出:5资源约定:峰值内存消耗< 256MCPU消耗< 1000ms请严格按要求输出,不要画蛇添足地打印类似:“请您输入...”的多余内容。
所有代码放在同一个源文件中,调试通过后,拷贝提交该源码。
注意: main函数需要返回0注意: 只使用ANSI C/ANSI C++ 标准,不要调用依赖于编译环境或操作系统的特殊函数。
注意: 所有依赖的函数必须明确地在源文件中#include <xxx>,不能通过工程设置而省略常用头文件。
提交时,注意选择所期望的编译器类型。
9、垒骰子赌圣atm晚年迷恋上了垒骰子,就是把骰子一个垒在另一个上边,不能歪歪扭扭,要垒成方柱体。
经过长期观察,atm 发现了稳定骰子的奥秘:有些数字的面贴着会互相排斥!我们先来规范一下骰子:1 的对面是4,2 的对面是5,3 的对面是6。
假设有m 组互斥现象,每组中的那两个数字的面紧贴在一起,骰子就不能稳定的垒起来。
atm想计算一下有多少种不同的可能的垒骰子方式。
两种垒骰子方式相同,当且仅当这两种方式中对应高度的骰子的对应数字的朝向都相同。
由于方案数可能过多,请输出模10^9 + 7 的结果。
不要小看了atm 的骰子数量哦~「输入格式」第一行两个整数n mn表示骰子数目接下来m 行,每行两个整数 a b ,表示 a 和 b 数字不能紧贴在一起。
「输出格式」一行一个数,表示答案模10^9 + 7 的结果。
「样例输入」2 11 2「样例输出」544「数据范围」对于30% 的数据:n <= 5对于60% 的数据:n <= 100对于100% 的数据:0 < n <= 10^9, m <= 36 资源约定:峰值内存消耗< 256MCPU消耗< 2000ms请严格按要求输出,不要画蛇添足地打印类似:“请您输入...”的多余内容。
所有代码放在同一个源文件中,调试通过后,拷贝提交该源码。
注意: main函数需要返回0注意: 只使用ANSI C/ANSI C++ 标准,不要调用依赖于编译环境或操作系统的特殊函数。
注意: 所有依赖的函数必须明确地在源文件中#include <xxx>,不能通过工程设置而省略常用头文件。
提交时,注意选择所期望的编译器类型。