高中数学必修三程序大全

上传人:xuey****n398 文档编号:159649508 上传时间:2022-10-09 格式:DOC 页数:6 大小:74.51KB
收藏 版权申诉 举报 下载
高中数学必修三程序大全_第1页
第1页 / 共6页
高中数学必修三程序大全_第2页
第2页 / 共6页
高中数学必修三程序大全_第3页
第3页 / 共6页
资源描述:

《高中数学必修三程序大全》由会员分享,可在线阅读,更多相关《高中数学必修三程序大全(6页珍藏版)》请在装配图网上搜索。

1、Program and list(应用程序和目录)01. BAS 求和a+aa+aaa+aaaa+.+aaa.a(a大于等1小于等于9的整数 Input “a=”;a Input “n=”;n T=0 S=0 i=1 While i=n T=10*t+a S=s+t I=i+1 Wend Print “s=”,send 02. BAS 求和a+aa+aaa+aaaa+.+aaa.a(a大于等1小于等于9的整数Input “a=”;a Input “n=”;n T=0 S=0 i=1 While i0 thenPrint “absolute value is”;xelseIf x=0 thenP

2、rint “absolute value is”;0 ElsePrint “abosolute value is”;-xEnd ifEnd ifend06.ABS任给一个自然数a( 输出aaaaa(n个a组成的n位数)Input “a=”;aInput “n=”;nS=0i=1while i=n s=s+10(i-1)i=i+1wendlet s=a*sprint send 07.BAS求和: Input “n=”;n i=1 s=0while i=0 thenLet p=-b/(2*a)Let q=SQR(d)/(2*a)If d=0 thenPrint “the equation is o

3、ne real root”;pElseX1=p+qX2=p-qPrint “two difference root”Print “x1=”;x1;”x2=”;x2End if End if End09.ABS解二元一次方程组 Program:Input a1,b1,c1,a2,b2,c2 m=a1*b2-a2*b1 p=b1*c2-b2*c1 q=c1*a2-c2*a1if m0 then x=p/m y=q/m print “x=”;x;”y=”;yelse if p=0 or q=0 then print “this binary linear equation group has num

4、berless solution” else print “this binary linear equation group has no solution” end if end if end 10BASaN,1a9,求a+aa+aaa+aaaa+.+aaa.a 的值 Program:Input “a=”;aInput “n=”;nLet i=1Let s=0dos=s+10(i-1)i=i+1loop until inlet s=a*sprint :s=”;send11.BAS 求两个正整数的最大公约数 【辗转相除法】program:input “m=”;minput “n=”;nif

5、m0r= m mod nif r=0 thenprint “the greatest common divisor of m and n is”;nelsem=nn=rend ifwendend12.BAS 把三个数a,b,c按从大到小的顺序排列input a,b,cif ab then t=a a=b b=tend ifif ac then t=a a=c c=tend ifif b=b then if a=c then if b=c then print a,b,c else print a,c,b end if else print c,a,b end ifelseif b=c then

6、 if a=c then print b,a,c else print b,c,a end if else print c,b,aend ifend ifend 14.BAS 任给一个大于1的自然数,判断这个数的奇偶性。programinput “n=”;nif n=2 then print “the number you input is a prime”else i=2 do r=n mod i i=i+1 loop until in-1 or r=0 if r=0 then print “the number is not a prime”elseprint “the number is

7、 a prime” end ifend ifend15.BAS求和: input “n=”;ni=1s=0 while in print “s=”;send17.求一个数的方根,开方(The extraction of a root of a quantity) (extraction of root)方根,开方 program: input x,n m=1/n y=xm print y end18.BAS 求一个数的算术平方根 program: input “x=”;x if x=0 then print “arithmetic square root is”;sqr(x) else pri

8、nt “no arithmetic square root” end ifend19BAS 判断年份是闰年的程序input “your year is”;xif x mod 4=0 and x mod 1000 then print “the year is leap year”else if x mod 400=0 then print “the year is leap year” else print “the year is not leap year” end ifend ifend20.BAS计算当x=1,2,320时,函数 的函数值x=1while x 20end22.BAS (

9、阶乘factorial)用程序计算n的阶乘input “n=”;nif n=0 then print “0!=1”else if n=1 theni=1f=1while i=nf=f*ii=i+1print “the number factorial is”;f wend end ifend if end如果输出语句改为:print n; “!=”;f则屏幕显示为:n!=f0!=11!=12!=23!=64!=245!=12023BAS 输出1到100之间的偶数PROGRAM:i=1While i100End 25BAS 输出1到100之间的偶数PROGRAM:i=1dor=i mod 2if

10、 r=0 then print i; end if i=i+1loop until i100End26BAS 输出1到100之间的3的倍数PROGRAM:i=1While i100End28BAS 输出1到100之间的3的倍数PROGRAM:i=1dor=i mod 2if r=0 then print i; end if i=i+1loop until i100End29.BAS 求两个正整数的最大公约数 【辗转相除法】program:input “m=”;minput “n=”;nif mn then t=m m=n n=tend if dor= m mod nif r=0 thenpri

11、nt “the greatest common divisor of m and n is”;nelsem=nn=rend ifloop until r=0end30.BAS 求两个正整数的最大公约数 【辗转相除法】the program is :1:input m,n2:if mn thent=mm=nn=tend if 3:r=m mod n4:if r=0 then if n=1 then print “two number is each other prime number” else print n end if else m=nn=rgoto 3 end if5:end 30.BAS 求5次多项式 当 时的什值program :input a5,a4,a3,a2,a2,a1,a0input x0n=1v=a5while n=5i=5-nv=v*x0+ain=n+1wendprint vend

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!