欢迎来到三一文库! | 帮助中心 三一文库31doc.com 一个上传文档投稿赚钱的网站
三一文库
全部分类
  • 研究报告>
  • 工作总结>
  • 合同范本>
  • 心得体会>
  • 工作报告>
  • 党团相关>
  • 幼儿/小学教育>
  • 高等教育>
  • 经济/贸易/财会>
  • 建筑/环境>
  • 金融/证券>
  • 医学/心理学>
  • ImageVerifierCode 换一换
    首页 三一文库 > 资源分类 > DOC文档下载  

    visual foxpro程序设计练习题(Visual foxpro程序设计练习题).doc

    • 资源ID:9186058       资源大小:21.15KB        全文页数:33页
    • 资源格式: DOC        下载积分:6
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录   微博登录  
    二维码
    微信扫一扫登录
    下载资源需要6
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    visual foxpro程序设计练习题(Visual foxpro程序设计练习题).doc

    visual foxpro程序设计练习题(Visual foxpro程序设计练习题)Visual FoxPro programming exercises3, seek the maximum natural number n within 100, so that the sum of the reciprocal of the successive n natural numbers from 1 is less than 3.5.Answer: 18S=0For i=1 to 100S=s+1/iIf s>=3.5ExitEndiENDFI-1?5, to find within 100, making the formula 1*2+2*3+. The maximum natural number n of +n* (n+1) is less than 5000.Answer: 23S=0For i=1 to 100S=s+i* (i+1)If s>=5000ExitEndiENDFI-1?7, a country with a population of 100 million this year, if the annual rate of 4% increments, try to find out, at least in a few years, the countrys population will double.Answer: 18N=0X=1Do while x<2X=x* (1+0.04)N=n+1EnddoN?8, set geometric series: 1, 3, 9, 27,. The minimum natural number n that makes the sum of the first n term of this sequence greater than 2345678.Answer: 14S=0N=0Do while s<=2345678S=s+3nN=n+1EnddoN?9, for 45678 of all non trivial factors (i.e. except 1 and itself a number of factors) is odd.Answer: 7N=0S=45678For i=3 to 22839 step 2If mod (s, I) =0N=n+1EndifEndforN?10, find all the true factor 203267 (i.e. less than its maximum number of divisors) factor.Answer: 6557S=203267For, i=1, to, int (203267/3)If mod (s, I) =0N=iEndifEndforN?11, calculate the greatest common divisor of 20677 and 42067.Answer: 713For i=20677 to 1 step -1If, mod (20677, I), =0, and, mod (42067, I) =0ExitEndifEndforI?13, seek all the minimum two digit AB (a*10+b) that matches the formula ab*ba=2701. Among them, a and B are integers between 19.Answer: 37For a=1 to 9For b=1 to 9If (a*10+b) * (b*10+a) =2701A*10+b?ReturnEndifEndforEndfor14, known sequence: 1,2,4,7,11,16,. The law is that the difference between the two adjacent items is 1,2,3,4,5,. Try to find the smallest item in this series greater than 5000.Answer: 5051A=1N=1Do while a<5000A=a+nN=n+1EnddoA?15, the known sequence f (n),:f (1) =1, f (2) =4, when n=3,4,5,. Time, f (n), =3*f (n-1), -f (n-2). Try to find the smallest natural number n within 100, so that the term n of this series is greater than 87654321.Answer: 20Dimension f (100)F (1) =1F (2) =4N=2Do while f (n) < 87654321N=n+1F (n), =3*f (n-1), -f (n-2)EnddoN?16, a ball from 100 meters high fell to the ground, and repeatedly re bounce down again, assuming that each rebound height is the height of the previous 3/4 times, try to derive the maximum number of N, the total distance from the ball began to fall to the ground when the N in the vertical direction through no more than 690 meters.Answer: 15H=100S=100N=1Do while s<690H=h*3/4S=s+2*hN=n+1EnddoN-1?17, set the 26 letters that are represented by 26 letters: a=1, b=1/ (a+1), and c=1/ (b+2),. Z=1/ (y+25). Try to find the number of letters in the 26 letters whose value is less than 0.1.Answer: 16A=1N=0For i=1 to 25A=1/ (a+i)If a<0.1N=n+1EndifEndforN?19. Seek the sum of the numbers in 100999 that do not contain the number 0 and the product of which the numbers are divisible by 96.Answer: 26640S=0For a=1 to 9For b=1 to 9For c=1 to 9If (mod (a*b*c),96) = 0)s = s + a) * 100 * 10 + (c) + (b)ownendfendfendf? s20、将大于1000且能被4和6中至少一个数整除的所有整数按从小到大顺序排列后, 求前面20个数之和.答案: 20610a = 1001n = 0s = 0do while n < 20if mod (a, 4) = 0 or mod (a, 6) = 0s = s + a)n = n + 1endifa = a + 1enddo? s21、若一个自然数恰好是它的平方的末后几位数, 则称此数为自同构数.如5和76都是自同构数, 因为它们的平方分别是25和5776.求 299999 内所有自同构数之和. (提示: 若x是m位同构数, 则x的平方除以10的m次方的余数就是x)答案: 101114s = 0for i = 2 to 999999if mod (i * i, 10) or mod (i) = i * i, 100) or mod (i * = i = i i, 1000) or mod (i * i, 10000) or mod (i * = i = i i, 100000)s = s + iendifendfor? s22、求满足条件a * b = 54321且使a + b的值最小的自然数对a、b中较小的一个数. (提示: 设a < = (b), 当a越大时a + b越小)答案: 57s1 = 54322for i = 1 to int (sqrt (54321)if (54321% i = = 0)s = i + 54321 / iif (s, < = s1).s1 = sa = iendifendifendfor? (a)23、已知数列: 1、2、4、7、10、15、., 其特点是: 相邻两项之差恰好构成自然数列: 1、2、3、4、5、.求此数列的前100项中能被4整除的项的个数.答案: 25the m = 0a = 1for n = 1 to 99(a) = (a + nif (a% = = 0)m = m + 1endifendfor? m24、求出将十进制整数98765432等值转换为二进制形式表示后其中数字1的个数. (提示: 模拟人工计算的 "2除取余" 法)答案: 13c = 98765432n = 0do while (c > 0if (c% 2 = = 1)n = n + 1endif(c) = int (c) / 2)enddo? n25、对自然数a、b、c, 若a < b < c且a * (a + b) * b = c * c, 则称 a, b, c 为一组勾股弦数, 其中a、b、c分别称为勾、股、弦.试求出弦为25000的勾股弦数组的个数.答案: 5n = 0for b = 12500 to 25000for a = 1 to b - 1if a * b = a + b * * 25000 25000n = n + 1endifendforendfor? n26、求方程3x - 7y = 1在条件 | x < y < | 100且 | | 40下的整数解的个数.答案: 26n = 0for x = - 99 to 99for y = - 39 to 39if 3 * x * y = = 1 - 7)n = n + 1endifendforendfor? n27、已知数列 f (n) (f (1) = 1, f (2) = 4, 当n = 3,4,5,.时, f (n) = 3 * f (n - 1) - f (n - 2).试求出100以内最大的自然数n使得此数列的前n项之和首次大于75364321.答案: 19dime f (100)f (1) = 1,f (2) = 4s = 5for n = 3 to 100f (n) = 3 * f (n - 1) - f (n - 2)s = s + f (n)if s > 75364321exitendifendfor? n28、求100200内的所有素数的个数 (素质是指只能被1和本身整除的数).答案: 21n = 0for i = 100 to 200for j = 2 to i - 1if (i% j = = 0)exitendifendforif j = = in = n + 1endifendfor? n29、求100010000内的第50个素数 (素质是指只能被1和本身整除的数).答案: 1361n = 0for i = 1000 to 10000.for j = 2 to i - 1if (i% j = = 0)exitendifendforif j = = in = n + 1endifif (n = = 50exitendifendfor? i30、编写程序,How many such numbers are computed within 10000, with a single digit of 6 and the number divisible by 9.Answer: 111N=0For i=1 to 10000If i%10=6 and i%9=0N=n+1EndifEndforN?31, set a number of four digits of the sum of squares is equal to 100, ask how many of these four figures?Answer: 49N=0For i=1000 to 9999A=int (i/1000)B=int (i/100)%10C=int (i/10)%10D=i%10If a2+b2+c2+d2=100N=n+1EndifEndforN?32, to a one dollar bill, replaced by a point, two points and five points coins, each at least 11, and asked how many kinds of programs?Answer: 13N=0For a=11 to 20For b=11 to 50For c=11 to 100If a*5+b*2+c=100N=n+1EndifEndforEndforEndforN?33, to a one dollar bill, replaced by a point, two points and five points coins, each at least 1 pieces, the total number of coins asked after the exchange with the least number of gold coins in total difference is how much?Answer: 73Max=3Min=300For a=1 to 20For b=1 to 50For c=1 to 100If a*5+b*2+c=100S=a+b+cIf (s>max)Max=sEndifIf (s<min)Min=sEndifEndifEndforEndforEndforMax-min?34, to find the following conditions: X2+Y2=412 and X+Y value of the largest two positive integers X, Y, the value of X+YAnswer: 49Max=41For x=1 to 41For y=x to 41If x*x+y*y=41*41 and max<x+yMax=x+yEndifEndforEndforMax?35, it is known that 24 has 8 positive integer factors (i.e.: 1,2,3,4,6,8,12,24), and 24 is exactly divisible by the number 8 of its factor. The number of numbers that 100300 can be divisible by the number of its factors.Answer: 19M=0For i=100 to 300N=0For j=1 to IIf i%j=0N=n+1EndifEndforIf i%n=0M=m+1EndifEndforM?36, S = 1-1/2+1/3-1/4+ = the sum of the first 100 (accurate to 4 decimal places)Answer: 0.6882F=1S=0For n=1 to 100S=s+f*1/nF=-fEndforRound (s, 4)37, write procedures for a total of several groups of I, J, K, consistent with the formula ijk+kji=1333, in which I, J, K, 09 is an integer between.Answer: 6N=0For i=0 to 9For j=0 to 9For k=0 to 9If i*100+j*10+k+k*100+j*10+I=1333N=n+1EndifEndforEndforEndforN?38, write programs, in the four digit even number, all your figures and is 30 multiples of the sum of the sum.Answer: 288840Sum=0For i=1000 to 9999 step 2A=int (i/1000)B=int (i/100)%10C=int (i/10)%10D=i%10If (a+b+c+d)%30=0Sum=sum+iEndifEndforSum?39, write procedures for 1 to 5000 can be divided by 5 before the even number of even, and when the value is greater than 500 exit, the output and value.Answer: 550S=0For i=2 to 5000 step 2If i%5=0S=s+iIf s>500ExitEndifEndifEndforS?40, if a number coincides with all its factors and equal, claimed that the number one end of a few, such as: 6=1+2+3, 6 is a perfect number. For 200 to 500 of all completed and.Answer: 496Sum=0For i=200 to 500S=0For j=1 to I-1If i%j=0S=s+jEndifEndforIf S = rSum = SUM + IEndifEndfor? Sum43、编写程序, 计算在0 50的范围内有多少个数, 其每位数的乘积大于每位数的和.答案: 23N = 0For I = 0 to 50A = Int (1 / 10)I B = 10%If a * B > a + BN = N + 1EndifEndfor? N44、用一元纸币兑换一分、两分和五分的硬币, 要求兑换硬币的总数为60枚, 问共有多少种换法? (注: 在兑换中, 一分、两分或五分的硬币数可以为0枚)答案: 11N = 0For a = 0 to 20For B = 0 to 50A - B - C = 60If a * B * 5 + 2 + C = 100N = N + 1EndifEndforEndfor? N46、有5羊4犬3鸡2兔值钱1496,4羊2犬6鸡3兔值钱1175,3羊1犬7鸡5兔值钱958,2羊3犬5鸡1兔值钱861, 求鸡值多少钱?答案: 23For a = 1 to 300For B = 1 to 300For C = 1 to 170D = 861 - 2 * 3 * 5 * - B - CIf 4 * 2 * A + B + C + D * 6 * 3 = 1175 and 3 * 7 * A + B + C + D = 958 and 5 * 5 * 4 * 3 * + (B + C + D = 2 * 1496? CReturnEndifEndforEndforEndfor47、编写程序, 求出3到100之间的所有非偶数非素数的数之和.答案: 1441S = 0For I = 1 to 100 STEP 2For J = I - 1 to 2If I% j = 0ExitEndifEndforIf J < I.S = S + IEndifEndfor? S48、有50个学生一起买小吃, 共花钱200元, 其中每个大学生花5元, 每个中学生花3元, 每个小学生花2元, 问大、中、小学生的人数分配共有多少种不同的解 (去掉某类学生为0的)?答案: 8N = 0For X = 1 to 40For y = 1 to 70- X - and Z = 50If x * * 5 + 2 and 3 + Z * = 200N = N + 1EndifEndforEndfor? N50、编写程序, 求一正整数等差数列的前五项的立方和, 该数列前四项之和是26、之积是880.答案: 4720For a = 1 to 5For D = 1 to 4If 4 + 6 * * * 26 and D = (A + D (A + 2) * * * (d) * (D + 3) = 880? A 3 + (A + D) 3 + 2 * d) 3 + 3 * d) 3 + 4 * d) 3EndifEndforEndfor

    注意事项

    本文(visual foxpro程序设计练习题(Visual foxpro程序设计练习题).doc)为本站会员(rrsccc)主动上传,三一文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    经营许可证编号:宁ICP备18001539号-1

    三一文库
    收起
    展开