2022年高中数学必修三程序大全

上传人:高**** 文档编号:233946307 上传时间:2022-01-03 格式:DOCX 页数:6 大小:73.87KB
返回 下载 相关 举报
2022年高中数学必修三程序大全_第1页
第1页 / 共6页
2022年高中数学必修三程序大全_第2页
第2页 / 共6页
2022年高中数学必修三程序大全_第3页
第3页 / 共6页
2022年高中数学必修三程序大全_第4页
第4页 / 共6页
2022年高中数学必修三程序大全_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《2022年高中数学必修三程序大全》由会员分享,可在线阅读,更多相关《2022年高中数学必修三程序大全(6页珍藏版)》请在金锄头文库上搜索。

1、可编辑资料 - - - 欢迎下载Program and list 应用程序和目录 01. BAS求和 a+aa+aaa+aaaa+.+aaa.a大a 于等1 小于等于 9 的整数Input “a=”;a Input “n=”;n T=0S=0i=1While i=n T=10*t+a S=s+t I=i+1WendPrint “s=”,s end02. BAS求和 a+aa+aaa+aaaa+.+aaa.a大a 于等1 小于等于 9 的整数Input “a=”;a Input “n=”;n T=0S=0i=1While i0thenPrint “ absolutevalue is”;xelse

2、If x=0thenPrint “absolute value is”;0 ElsePrint “abosolute value is”;-xEnd ifEnd if end06.ABS任给一个自然数 aa1,9输出 aaaa an 个 a 组成的 n 位数Input “a=”;a Input “n=”;n S=0i=1while i=n s=s+10i-1 i=i+1wendlet s=a*s print s end07.BAS可编辑资料 - - - 欢迎下载Print “s=”,s end求和:110102103.10n可编辑资料 - - - 欢迎下载可编辑资料 - - - 欢迎下载03.

3、 BAS求 a bb a 值Input “n=”;n i=1s=0可编辑资料 - - - 欢迎下载Input “a=”;a; Input “b=”;bPrint “s=”;ab+ba Endwhile i=0 thenLet p=-b/2*aLet q=SQRd/2*a If d=0 thenPrint “the equation is one real roo”t;pElse X1=p+q X2=p-qPrint “two difference root” Print “x1=”;x1; ”x2=”;x2End if End ifEnd10. BAS a N,1 a 9,求 a+aa+aaa

4、+aaaa+.+aaa.a的值Program:Input “a=”;a Input “n=”;nLet i=1Let s=0dos=s+10i-1 i=i+1loop until in let s=a*s print :s=”;s end11. BAS 求两个正整数的最大公约数【辗转相除法 】可编辑资料 - - - 欢迎下载可编辑资料 - - - 欢迎下载09.ABSa xb yc0program:input “m=”;m input “n=”;n可编辑资料 - - - 欢迎下载解二元一次方程组111a2 xb2 yc20Program:Input a1,b1,c1,a2,b2,c2m=a1*

5、b2-a2*b1 p=b1*c2-b2*c1 q=c1*a2-c2*a1if m0thenx=p/m y=q/mprint “x= ”;x;”y=”;yelseif p=0 or q=0 thenprint “this binary linear equation group has numberless solution” elseprint“thisbinarylinearequation group has no solution” end ifend if endif m0r= m mod nif r=0 thenprint “the greatest common divisor o

6、f m and n is”;nelsem=n n=rend ifwend end可编辑资料 - - - 欢迎下载可编辑资料 - - - 欢迎下载12.BAS把三个数 a,b,c 按从大到小的次序排列input a,b,c if ab then14.BAS任给一个大于 1 的自然数,判定这个数的奇偶性.可编辑资料 - - - 欢迎下载end ifif ac thenend ifif bn-1 or r=0 if r=0 thenprint “the number is not a prime” elseprint “the number is a prime”end ifend if end可编

7、辑资料 - - - 欢迎下载把三个数 a,b,c 按从大到小的次序排列15.BAS可编辑资料 - - - 欢迎下载program:input “a=”;a求和: 2345n1234n可编辑资料 - - - 欢迎下载input “b=”;b input “c=”;c if a=b thenif a=c thenif b=c thenprint a,b,celseprint a,c,b end ifelseprint c,a,binput “n=”;ni=1 s=0while i=c then求和: 2345n1234n可编辑资料 - - - 欢迎下载elseif a=c thenprint b,

8、a,celseprint b,c,a end ifinput “n=”;ni=1 s=0 dos=s+i+1/i i=i+1loop until in可编辑资料 - - - 欢迎下载print c,b,a end ifend ifendprint “s=”;s end可编辑资料 - - - 欢迎下载可编辑资料 - - - 欢迎下载17.求一个数的方根,开方The extraction of a root of a quantity( extraction of root)方根,开方program:input x,nm=1/n y=xmprint y end18.BAS20.BAS运算当 x=1

9、,2, 3 20 时,函数 f xx23x5 的函数值x=1while x =0 thenprint “ arithmeticsquare root is”;sqrx elseprint “no arithmetic square roo”tend if end19 BASloop until x20 end22. BAS阶乘 factorial用程序运算 n 的阶乘input “n=”;n if n=0 thenprint “0.=1”elseif n=1 theni=1 f=1可编辑资料 - - - 欢迎下载判定年份是闰年的程序input “your year is”;xif x mod

10、4=0 and x mod 1000 then print “the year is leap yea”relseif x mod 400=0 thenend if endwhile i=nf=f*i i=i+1print “the number factorial is ”;fwend end if可编辑资料 - - - 欢迎下载print “the year is leap yea”r elseprint “the year is not leap yea”rend if end if end假如输出语句改为:print n; “.= ”;f就屏幕显示为: n.=f0.=11.=12.=23.=64.=245.=120可编辑资料 - - - 欢迎下载可编辑资料 - - - 欢迎下载23. BAS输出 1 到 100 之间的偶数PROGRAM:i=1While i=100 i=i+1r=i mod 2if r=0 then Print i;end ifWend End说

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 中学教育 > 高中教育

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号