freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

華東師范大學(xué)計(jì)算機(jī)機(jī)試真題(已修改)

2025-04-08 01:42 本頁(yè)面
 

【正文】 2009機(jī)試 2計(jì)算和的數(shù)位 2大寫改小寫 3素?cái)?shù)對(duì) 4求最大公約數(shù)和最小公倍數(shù) 6排序后求位置處的數(shù) 7*路由器連接 8*編譯原理 10*分開連接 132010機(jī)試 17ECNU的含義 17空瓶換啤酒 18統(tǒng)計(jì)字符 202010機(jī)試熱身 21粽子買三送一,買五送二 21工程流水線問(wèn)題 222011機(jī)試 24hello world 24Special judge 26查詢成績(jī) 282011機(jī)試熱身 30貪吃蛇 30仰望星空 34*編輯距離 362012機(jī)試 38字母排序 38幸運(yùn)數(shù) 39十六進(jìn)制的加法 42電話號(hào)碼簿合并排序 42*五子棋 43*正則表達(dá)式匹配 452013機(jī)試 46斐波那契數(shù)列的素?cái)?shù)個(gè)數(shù) 46*將a字符變成b字符最少修改次數(shù) 472013機(jī)試熱身 49去重排序 49蛇形圖案 51數(shù)學(xué)手稿 542009機(jī)試計(jì)算和的數(shù)位Sum of digit Description Write a program which putes 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 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,amp。n)!=EOF){while(n){ int an=0。 scanf(%d%d,amp。a,amp。b)。 sum=a+b。 while(sum) { an++。 sum/=10。 } printf(%d\n,an++)。}}return 0。}大寫改小寫Capitalize Description Write a program which replace all the lowercase letters of a given text with the corresponding captital letters. Input A text including lowercase letters, periods, and space.Output Output The converted text. Sample Input wele to east china normal university. Sample Output WELCOME TO EAST CHINA NORMAL UNIVERSITY. includeincludechar str[1000]。int main(){int l。while(gets(str)){l=strlen(str)。int i。for(i=0。il。i++){if(str[i]=39。a39。amp。amp。str[i]=39。z39。)printf(%c,str[i]32)。elseprintf(%c,str[i])。}printf(\n)。}return 0。}素?cái)?shù)對(duì)Primes Pair Description We arrange the numbers between 1 and N (1 = N = 10000) 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 pute 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 ≤ 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 includeincludebool prime[10005]。void init(){int i。int j。prime[0]=prime[1]=false。//不是素?cái)?shù)prime[2]=true。//是素?cái)?shù)for(i=3。i=10005。i+=2){prime[i]=true。//是素?cái)?shù)prime[i+1]=false。//不是素?cái)?shù) 除0和2之外的偶數(shù)都不是素?cái)?shù)}for(i=3。i=10005。i+=2){if(prime[i]==true)//是素?cái)?shù){j=i+i。while(j=10005){prime[j]=false。//不是素?cái)?shù)j+=i。}}}}int main(){int c。int n。init()。//初始化while(scanf(%d,amp。c)!=EOF){while(c){scanf(%d,amp。n)。int sum=0。int i。for(i=2。i=n/2。i++){if(prime[i]==trueamp。amp。prime[n+1i]==true)sum++。}sum*=2。if(n%2==1)//n為奇數(shù){if(prime[n/2+1]==true)sum+=1。}printf(%d\n,sum)。}}return 0。}求最大公約數(shù)和最小公倍數(shù)GCD and LCM Description Write a program which putes the greatest mon divisor (GCD) and the least mon 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 case 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。t2=gcd。gcd=t1%t2。}return t2。}int main(){int n。int a,b。while(scanf(%d,amp。n)!=EOF){while(n){scanf(%d%d,amp。a,amp。b)。printf(%d %d\n,getgcd(a,b),a*b/(getgcd(a,b)))。}}return 0。}排序后求位置處的數(shù)Sort it… Description There is a database,partychen want you to sort the database’s data in the order from the least up to the greatest element,then do the query: Which element is ith 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 there39。s a sequence of queries. The format of database is very simple: in the first line there39。s 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 = 100) is written, and in the next K lines there are queries one in each line. The query Which element is ith 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 element from the database, which is ith by its value (in the order from the least up to the greatest element). Sample Input 5712112371213325 Sample Output 1217123includeincludealgorithmusing namespace std。int num[100010]。int pos[105]。int main(){int n。int i。int k。while(scanf(%d,amp。n)!=EOF){for(i=1。i=n。i++)scanf(%d,amp。num[i])。scanf(%d,amp。k)。for(i=1。i=k。i++)scanf(%d,amp。pos[i])。sort(num+1,num+1+n)。for(i=1。i=k。i++)printf(%d\n,num[pos[i]])。}return 0。}*路由器連接Hub Connection plan Description Partychen is working as system administrator and is planning to establish a new network in his pany. There will be N hubs in the pany, they can be connected to each other using cables. Since each worker of the pany must have access to the whole network, each hub must be accessible by cables from any other hub (with possibly some intermediate hubs). Since cables of different types are available and shorter ones are cheaper, it is necessary to make
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
公安備案圖鄂ICP備17016276號(hào)-1