ProblemDescription: Anumbersequenceisdefinedasfollows:f(1)=1,f(2)=1,f(n)=(Af(n1)+Bf(n2))mod7.GivenA,B,andn,youaretocalculatethevalueoff(n).  Input:  Theinputconsistsofmultipletestcases.Eachtestcasecontains3integersA,Bandnonasingleline(1<=A,B<=1000,1<=n<=100,000,000).Thre...

Description: FredMapperisconsideringpurchasingsomelandinLouisianatobuildhishouseon.Intheprocessofinvestigatingtheland,helearnedthatthestateofLouisianaisactuallyshrinkingby50squaremileseachyear,duetoerosioncausedbytheMississippiRiver.SinceFredishopingtoliveinthishousetherestofhislife,heneedstok...

  7PTocT0TRZH3   2023年11月02日   102   0   0 ci其他ideci其他#includeide#include

Description: Bullsaresomuchbetteratmaththanthecows.Theycanmultiplyhugeintegerstogetherandgetperfectlypreciseanswers...orsotheysay.FarmerJohnwondersiftheiranswersarecorrect.Helphimcheckthebulls'answers.Readintwopositiveintegers(nomorethan40digitseach)andcomputetheirproduct.Outputitasanormalnumb...

ProblemDescription: 输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。  Input:  输入包含多组测试用例,每组输入数据只有一行数字(数字之间没有空格),这行数字的长度不大于1000。  输入数据保证:分割得到的非负整数不会大于100000000;输入数据不可能全由‘5’组成。  Outpu...

题目描述: Fibonacci数列的递推公式为:Fn=Fn-1+Fn-2,其中F1=F2=1。当n比较大时,Fn也非常大,现在我们想知道,Fn除以10007的余数是多少。  输入:  输入包含一个整数n。 数据规模与约定 1<=n<=1,000,000。  输出: 输出一行,包含一个整数,表示Fn除以10007的余数。  样例输入:  10 样例输出:  55  提示:  在本题中,答案是要求Fn除以10007的余数,因此我们只要能算出这个余数即可,而不需要先计算出Fn的准确值,再...

  7PTocT0TRZH3   2023年11月02日   81   0   0 iosci其他iosci其他#include#include

题目描述: 对于长度为5位的一个01串,每一位都可能是0或1,一共有32种可能。它们的前几个是:0000000001000100001100100请按从小到大的顺序输出这32种01串。  输入:  本试题没有输入。  输出:  输出32行,按从小到大的顺序每行一个长度为5的01串。  样例输入:  无  样例输出:  00000 00001 00010 00011 <以下部分省略>  程序代码:  C/C版本:  include<stdio.h&g...

题目描述: 笨小猴的词汇量很小,所以每次做英语选择题的时候都很头疼。但是他找到了一种方法,经试验证明,用这种方法去选择选项的时候选对的几率非常大! 这种方法的具体描述如下:假设maxn是单词中出现次数最多的字母的出现次数,minn是单词中出现次数最少的字母的出现次数,如果maxn-minn是一个质数,那么笨小猴就认为这是个LuckyWord,这样的单词很可能就是正确的答案。 输入:  一个单词,其中只可能出现小写字母,并且长度小于100100100。 输出:  共两行,第一行是一个字符串,假设输入的的单词是LuckyWord,那么输出“LuckyWord”,...

ProblemDescription: Ignatiusdrinksmilkeveryday,nowheisinthesupermarketandhewantstochooseabottleofmilk.Therearemanykindsofmilkinthesupermarket,soIgnatiuswantstoknowwhichkindofmilkisthecheapest.Herearesomerules:1.Ignatiuswillneverdrinkthemilkwhichisproduced6daysagoorearlier.Thatmeansifthemilkisp...

ProblemDescription: lcygivesahardpuzzletofeng5166,lwg,JGShiningandIgnatius:gaveaandb,howtoknowthea^b.everybodyobjectstothisBTproblem,solcymakestheproblemeasierthanbegin.thispuzzledescribesthat:gaveaandb,howtoknowthea^b'sthelastdigitnumber.Buteverybodyistoolazytoslovethisproblem,sotheyremittoyo...

ProblemDescription: Anumberwhoseonlyprimefactorsare2,3,5or7iscalledahumblenumber.Thesequence1,2,3,4,5,6,7,8,9,10,12,14,15,16,18,20,21,24,25,27,...showsthefirst20humblenumbers.Writeaprogramtofindandprintthenthelementinthissequence  Input:  Theinputconsistsofoneormoretestcases.Eachtes...

  7PTocT0TRZH3   2023年11月02日   40   0   0 其他sedC++丑数C++其他丑数sed

ProblemDescription: Ignatiuslikestowritewordsinreverseway.GivenasinglelineoftextwhichiswrittenbyIgnatius,youshouldreverseallthewordsandthenoutputthem.  Input:  Theinputcontainsseveraltestcases.ThefirstlineoftheinputisasingleintegerTwhichisthenumberoftestcases.Ttestcasesfollow.Eachte...

ProblemDescription: GivenapositiveintegerN,youshouldoutputthemostrightdigitofN^N.  Input:  Theinputcontainsseveraltestcases.ThefirstlineoftheinputisasingleintegerTwhichisthenumberoftestcases.Ttestcasesfollow.EachtestcasecontainsasinglepositiveintegerN(1<=N<=1,000,000,000).&nbs...

  7PTocT0TRZH3   2023年11月02日   35   0   0 ci其他C++gitC++ci其他git

ProblemDescription: OneofthefirstusersofBIT'snewsupercomputerwasChipDiller.Heextendedhisexplorationofpowersof3togofrom0to333andheexploredtakingvarioussumsofthosenumbers.``Thissupercomputerisgreat,''remarkedChip.``IonlywishTimothywereheretoseetheseresults.''(Chipmovedtoanewapartment,onceonebeca...

  7PTocT0TRZH3   2023年11月02日   115   0   0 iosci其他iosci其他#include#include

ProblemDescription: AbiologistexperimentingwithDNAmodificationofbacteriahasfoundawaytomakebacterialcoloniessensitivetothesurroundingpopulationdensity.BychangingtheDNA,heisableto“program”thebacteriatorespondtothevaryingdensitiesintheirimmediateneighborhood.Theculturedishisasquare,dividedinto400...

  7PTocT0TRZH3   2023年11月02日   72   0   0 i++i++其他ide其他#includeide#include

题目描述: 马上要举办新生程序设计竞赛了,与以往不同的是,本次比赛以班为单位,为了全面衡量一个班级的整体水平,要求从一个班的m位同学中任选k位同学代表本班参加比赛,问有多少种组合方案。显然,这个组合数是m!/(k!(m-k)!)。要求编写函数fact(),实现求一个数的阶乘功能,在主函数中调用此函数。 intfact(intn){   //函数返回值为n的阶乘。}  对于C/C代码的提交,本题要求必须通过定义fact函数和main函数实现,否则,提交编译错误,要提交完整的程序。  输入:  输入两个正整数m,k...

题目描述: 春天是鲜花的季节,水仙花就是其中最迷人的代表,数学上有个水仙花数,他是这样定义的:“水仙花数”是指一个三位数,它的各位数字的立方和等于其本身,比如:153=13+53+33。现在要求输出所有在m和n范围内的水仙花数。  要求程序定义一个narcissus()函数和一个main()函数,narcissus()函数判断一个整数n是否为水鲜花数,其余功能在main()函数中实现。   intnarcissus(intn)    {        /...

题目描述: 输入某位同学各门课的成绩,输出平均成绩。输入的成绩均为五级制成绩,五级制成绩转换为百分之成绩的规则如下:'A'转换为百分之成绩为95分,'B'对应85分,C对应75分,'D'对应65分,'E'对应40分。输出的平均成绩为一个实数,保留1位小数。  要求程序定义一个getScore()函数和一个main()函数,getScore()函数返回一个等级对应的分数,其余功能在main()函数中实现。intgetScore(charg){ //把等级g转换成对应的分数并返回这个分数。 } 对于C/C代码的提交,本题要求必须通过定义getScore函数...

  7PTocT0TRZH3   2023年11月02日   77   0   0 i++i++其他JavaSystem其他javaSystem

题目描述: 求复合函数F(G(x)),其中函数F(x)=|x-3|+|x+1|,函数G(x)=x^2-3x。要求编写函数funF()和funG()分别求F(x)和G(x),其余功能在main()中实现。doublefunF(doublex){ //函数返回F(x)的值;}doublefunG(doublex){ //函数返回G(x)的值;} 本题如果是C/C代码提交,只需要提交funF和funG函数的定义部分,提交其它内容,编译出错。  输入: 输入一个实数x。  输出:  输出复合函数的值,结果保留2位小数。输出占一行。  样例输入:&...

题目描述: 输入一个正整数n。输出n!的最高位上的数字。  输入:  输入一个正整数n(n不超过1000)。  输出:  输出n!的最高位上的数字。  样例输入:  1000  样例输出:  4  程序代码:  importjava.util.; publicclassMain { publicstaticvoidmain(String[]args) { Scannerinput=newScanner(System.in); intn=input.nextInt(...

题目描述: 输入n和n个整数,以与输入顺序相反的顺序输出这n个整数。要求不使用数组,而使用递归函数实现。递归函数实现过程如下:voidinverse(intn){    if(n>1)  {      (1)读入一个整数,存入num;      (2) 将后面的n-1个数逆序输出:inverse(n-1);       (3) 输...

关注 更多

空空如也 ~ ~

粉丝 更多

空空如也 ~ ~