ImageVerifierCode 换一换
格式:DOCX , 页数:72 ,大小:36.07KB ,
资源ID:778174      下载积分:12 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/778174.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(华东师范大学计算机机试真题.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

华东师范大学计算机机试真题.docx

1、华东师范大学计算机机试真题华东师范大学计算机机试真题2009机试计算和的数位Sum of digit Description Write a program which computes the digit number of sum of two integers a and b. Input The first line of input gives the number of cases, N(1 N 100). N test cases follow.Each test case consists of two integers a and b which are separeted

2、by a space in a line. (0=a,b=100000000). Output For each test case, print the number of digits of a + b. Sample Input 35 71 991000 999 Sample Output 234 #includeint main()int n;int a,b;int sum;while(scanf(%d,&n)!=EOF)while(n-) int an=0; scanf(%d%d,&a,&b); sum=a+b; while(sum) an+; sum/=10; printf(%dn

3、,an+);return 0;大写改小写Capitalize Description Write a program which replace all the lower-case letters of a given text with the corresponding captital letters. Input A text including lower-case letters, periods, and space.Output Output The converted text. Sample Input welcome to east china normal unive

4、rsity. Sample Output WELCOME TO EAST CHINA NORMAL UNIVERSITY. #include#includechar str1000;int main()int l;while(gets(str)l=strlen(str);int i;for(i=0;i=a&stri=z)printf(%c,stri-32);elseprintf(%c,stri);printf(n);return 0;素数对Primes Pair Description We arrange the numbers between 1 and N (1 = N = 10000)

5、 in increasing order and decreasing order like this: 1 2 3 4 5 6 7 8 9 . . . NN . . . 9 8 7 6 5 4 3 2 1Two numbers faced each other form a pair. Your task is to compute the number of pairs P such that both numbers in the pairs are prime. Input The first line of input gives the number of cases, C (1

6、C 100). C test cases follow.Each test case consists of an integer N in one line. Output For each test case, output P . Sample Input 414751 Sample Output 0226 #include#includebool prime10005;void init()int i;int j;prime0=prime1=false;/不是素数prime2=true;/是素数for(i=3;i=10005;i+=2)primei=true;/是素数primei+1=

7、false;/不是素数 除0和2之外的偶数都不是素数for(i=3;i=10005;i+=2)if(primei=true)/是素数j=i+i;while(j=10005)primej=false;/不是素数j+=i;int main()int c;int n;init();/初始化while(scanf(%d,&c)!=EOF)while(c-)scanf(%d,&n);int sum=0;int i;for(i=2;i=n/2;i+)if(primei=true&primen+1-i=true)sum+;sum*=2;if(n%2=1)/n为奇数if(primen/2+1=true)sum

8、+=1;printf(%dn,sum);return 0;求最大公约数和最小公倍数GCD and LCM Description Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given a and b (0 a, b 44000). Input The first line of input gives the number of cases, N(1 N 100). N test cases follow.Each test ca

9、se contains two interger a and b separated by a single space in a line. Output For each test case, print GCD and LCM separated by a single space in a line. Sample Input 28 65000 3000 Sample Output 2 241000 15000 #includeint getgcd(int a,int b)int gcd;int t1,t2;t1=a;t2=b;gcd=t1%t2;while(gcd!=0)t1=t2;

10、t2=gcd;gcd=t1%t2;return t2;int main()int n;int a,b;while(scanf(%d,&n)!=EOF)while(n-)scanf(%d%d,&a,&b);printf(%d %dn,getgcd(a,b),a*b/(getgcd(a,b);return 0;排序后求位置处的数Sort it Description There is a database,partychen want you to sort the databases data in the order from the least up to the greatest elem

11、ent,then do the query: Which element is i-th by its value?- with i being a natural number in a range from 1 to N.It should be able to process quickly queries like this. Input The standard input of the problem consists of two parts. At first, a database is written, and then theres a sequence of queri

12、es. The format of database is very simple: in the first line theres a number N (1=N=100000), in the next N lines there are numbers of the database one in each line in an arbitrary order. A sequence of queries is written simply as well: in the first line of the sequence a number of queries K (1 = K =

13、 100) is written, and in the next K lines there are queries one in each line. The query Which element is i-th by its value? is coded by the number i. Output The output should consist of K lines. In each line there should be an answer to the corresponding query. The answer to the query i is an elemen

14、t from the database, which is i-th by its value (in the order from the least up to the greatest element). Sample Input 5712112371213325 Sample Output 1217123#include#includeusing namespace std;int num100010;int pos105;int main()int n;int i;int k;while(scanf(%d,&n)!=EOF)for(i=1;i=n;i+)scanf(%d,&numi);scanf(%d,&k);for(i=1;i=k;i+

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1