浙江高中数学竞赛获奖-高中数学定考神针
Program and list(应用程序和目录)
01.
BAS
求和a+aa+aaa+aaaa+....+aaa....a(a大于等
1
小于等于9的整数
Input
Input
“
“
a=
n=
”
”
;a
;n
T=0
S=0
i=1
While i<=n
T=10*t+a
S=s+t
I=i+1
Wend
Print “
end
s=”,s
02.
求和
BAS
a+aa+aaa+aaaa+....+aaa....a(a
大于等
1
小于等于9的整数
Input
Input
“
“
a=
n=
”;a
”;n
T=0
S=0
i=1
While i<=n
t=t+a
s=s+t
t=10*a
i=i+1
Wend
Print “s=”,s
end
求
a
b
?b
a
值
Input
Input
“a=
Print
“b=
”
”
;a;
;b
End
“s=”;a^b+b^a
求一个数的绝对值
Input
Let y=abs(x)
“x=”;x
Print
“the number absolute value
is”;y
求一个数的绝对值
Inupt
If x>0
“x=
then
”;x
else
Print
“absolute value is”;x
If x=0
Print
Else
“absolute value is
then
”;0
Print “abosolute value is”;-x
End if
End if
end
任给一个自然数a(
a?[1,9]
输出
aaaa…a(n个a组成的n位数)
Input
Input
“a=”;a
S=0
“n=”;n
i=1
while
i<=n
i=i+1
s=s+10^(i-1)
wend
let s=a*s
print s
end
求和:
1?10?10
2
?10
3
?....?10
n
Input “n=”;n
while i<=n-1
i=1
s=0
s=s+10^(i-1)
wend
i=i+1
print
end
“s=”;s
解一元二次方程
Input
Input
“a=”;a
Input
“b=”;b
Let
If d>=0
“
c=
d=b^2
”;c
then
—4*a*c
Let p=-b(2*a)
If d=0
Let
q=SQR(d)(2*a)
Print
Else
“the equation
is one real root
then
”;p
X1=p+q
X2=p-q
Print
Print
“two difference
root
End if
End if
“x1=
”;x1;”x2=”;x2
”
End
解二元一次方程组
?
?
a
1
x?b
1
y?c
1
?0
?
a
2
x?b
2
y?c
2
?0
Program:
Input a1,b1,c1,a2,b2,c2
m=a1*b2-a2*b1
if m<>0
p=b1*c2-b2*c1
q=c1*a2-c2*a1
then
else
x=pm
y=qm
print “x=”;x;”y=”;y
if p=0 or q=0 then
print
“this binary
linear
else
group has numberless solution
equation
print “this binary
”
end if
equation group has no solution
linear
end if
”
end
10
a∈
.
N,1
BAS
≦a≦9,
求
a+aa+aaa+aaaa+....+aaa....a 的值
Program:
Input
Input
“
“
a=
Let i=1
n=
”
”
;a
;n
do
Let s=0
s=s+10^(i-1)
loop until i>n
i=i+1
let s=a*s
print :s=
end
”;s
求两个正整数的最大公约数
【辗转相除法】
program:
input
input
“
if
m
m=
n=”
”
;n
;m
t=m
end if
m=n
n=t
while r>0
r=1
r=
m mod n
if r=0 then
print
else
divisor of m and n is
“the greatest common
”;n
m=n
n=r
wend
end if
end
把三个数
a,b,c按从大到小的顺序排列
input a,b,c
if a
t=a
end if
a=b
b=t
if a
end if
t=a
a=c
c=t
if b
t=b
end
if
b=c
c=t
print a,b,c
end
把三个数
a,b,c按从大到小的顺序排列
program:
input
input
“a=”;a
input
“b=”;b
if a>=b then
“c=”;c
if
a>=c then
if b>=c
then
print
a,b,c
else
print
a,c,b
else
end if
print c,a,b
else
end if
if b>=c then
if a>=c then
else
print b,a,c
end if
print b,c,a
else
print c,b,a
end if
end if
end
数的奇偶性。
任给一个大于1的自然数,判断这个
program
input
if n=2 then
“n=”;n
else
print “the number you input is a prime”
i=2
do
r=n mod i
loop until i>n-1 or r=0
i=i+1
if r=0
then
else
print “the number is not a
prime”
print “the number is a
prime”
end if
end if
end
求和:
2?
3
?
4
?
5
???
?
n?1
234n
input “
i=1
n=”;n
s=0
while i<=n
s=s+(i+1)i
print
i=i+1
end
“
s=
wend
”;s
求和:
2?
3
?
4
?
5
????
n?1
input
234n
“
n=”;n
i=1
s=0
do
s=s+(i+1)i
print
i=i+1
end
“
s=
loop until i>n
”;s
17.
(The extraction of a
root of a quantity)
求一个数的方根,开方
(extraction of root
)方根,开方
program:
input x,n
m=1n
y=x^m
print y
end
求一个数的算术平方根
program:
input “x=”;x
if x>=0
then
print “arithmetic square root
is”;sqr(x)
else
print “no
arithmetic square root”
end
end if
19.
BAS
判断年份是闰年的程序
input
if x mod 4=0 and x mod 100<>0 then
“your year is”;x
else
print
“the year is leap year”
if x mod 400=0 then
else
print “the year is leap year”
print “the year is not leap
year”
end if
end if
end
计算当x=1,2,3…20时,函数
f(x)?x
2
?3x?5
的函数值
x=1
while x <=20
y=x^2-3*x+5
print
:x=”;x;”y=
wend
x=x+1
’;y
end
计算当x=1,2,3…20时,函数
f(x)?x
2
?3x?5
的函数值
x=1
do
y=x^2-3*x+5
loop until x>20
print :x=
x=x+1
”;x;”y=’;y
end
用程序计算
(阶乘
n的阶乘
factorial)
input
if n=0 then
“n=”;n
else
print “0!=1”
if n>=1 then
i=1
while i<=n
f=1
f=f*i
print “
i=i+1
the number factorial
is”;f
end if
end if
wend
end
如果输出语句改为:
print n;
则屏幕显示为:
“!=”;f
n!=f
0!=1
1!=1
2!=2
3!=6
4!=24
5!=120
23
.
BAS
输出1到100之间的偶数
PROGRAM
:
i=1
While i<=100
i=i+1
r=i mod 2
if
r=0 then
Wend
end if
Print i;
End
说明:输出语句末加分号表示按行
输出,否则按列输出
24
.
BAS
输出1到100之间的偶数
PROGRAM:
i=1
do
i=i+1
r=i mod 2
if r=0 then
print i;
loop until i>100
end
if
End
25
.
BAS
输出1到100之间的偶数
PROGRAM:
i=1
do
r=i mod 2
if r=0 then
i=i+1
print i;
end if
loop until i>100
End
26
.
BAS
输出1到100之间的3的倍数
PROGRAM
:
i=1
While i<=100
i=i+1
r=i mod 3
if
r=0 then
Wend
end if
Print i;
End
27
.
BAS
输出1到100之间的3的倍数
PROGRAM:
i=1
do
i=i+1
r=i mod 3
if
r=0 then
loop until i>100
print i;
end if
End
28
.
BAS
输出1到100之间的3的倍数
PROGRAM
i=1
:
do
r=i mod 2
if r=0 then
print i;
i=i+1
end if
loop
until i>100
End
求两个正整数的最大公约数
【辗转相除法】
program:
input
input
“m=
if m
”
;n
;m
t=m
end if
m=n
do
n=t
r= m mod n
if r=0 then
print
else
divisor of m and n is
“the
greatest common
”;n
m=n
n=r
end
loop until r=0
end if
求两个正整数的最大公约数
【辗转相除法】
the program is :
1:input m,n
2:if m
m=n
3:r=m mod n
end if
n=t
4:if r=0 then
other prime number
if n=1
then
print “two number is each
”
else
print n
end if
else
m=n
n=r
goto 3
5:end
end if
f(x)?a
求5次多项式
4
5
x
5
?a
4
x?a
3
x
3?a
2
2
x?a
1
x?a
当
x?x
0
0
时的什值
program :
input a5,a4,a3,a2,a2,a1,a0
input x0
n=1
v=a5
while n<=5
i=5-n
v=v*x0+ai
n=n+1
wend
print v
end
高中数学学考那些-初高中数学数学公式
高中数学论文函数-淮南哪里有补高中数学的老师
人教版高中数学教学要求-有没有高中数学专做大题的书
高中数学教与学投稿-高中数学选修2-2手机
高中数学必修一高考题-高中数学必修二几何试卷
高中数学选修课内容-高中数学学科教学整合研究
高中数学说课稿ppt模板-高中数学必修课有哪些
高中数学视频必修一-高中数学做好哪些衔接
-
上一篇:数学套路大全
下一篇:高中数学口诀大全高中数学知识顺口溜