10道编程题、、VF高手进啊、、急急急!!!!高分!!!!!

作者&投稿:彩衬 (若有异议请与网页底部的电邮联系)
求几道vf程序设计题得解答 急急急急!~

1.
*pro1.prg

clear
set talk off
s=0
for i=1 to 100
s=s+i
if s>1600
?i
exit
endif
endfor
set talk on
return

2.
*pro7.prg

clear
set talk off
s=1
for i=2 to 15
p=1
for j=1 to i
p=p*j
endfor
s=s/p
endfor
?"1!÷2!÷···÷15!=",s
set talk on
return

3.
*pro.prg
clear
store 0 to n,s
for i=1 to 10000
if mod(i,3)=0
s=s+i
n=n+1
endif
endfor
?"10000以内所有3的倍数之和s=",s
?"10000以内所有3的倍数个数n=",n
set talk on
return

go top
locate for 职工名称 = '赵红'
if found()
if gongzi < 200
repl gongzi with gongzi + 100
endif
endif

或者
update 工资表 set 工资 = 工资 + 100 where 职工 = '赵红' and 工资 < 200

1、
clear
text
一元二次方程求解
ax^2+bx+c=0
endtext
input "请输入a的值:" to a
input "请输入b的值:" to b
input "请输入c的值:" to c
m=b*b-4*a*c
if m>=0
x1=(-b+sqrt(m))/(2*a)
x2=(-b-sqrt(m))/(2*a)
?"x1的值是:",x1
?"x2的值是:",x2
else
?"此方程无实根!"
endif

2、
clear
for i=1 to 100
if i%3=0 and i%7=0
??i
endif
endfor

3、
clear
accept "请输入一个字符:" to x
x=asc(x)
do case
case x>=65 and x<=90 or x>=97 and x<=122
?"是字母"
case x>=48 and x<=57
?"是数字"
other
?"是其它字符"
endcase

4、
clear
s=1
for i=1 to 10
s=s*i
endfor
?s

5、
clear
s=""
input "请输入一个十进制数:" to a
do while a>0
b=a%2
a=int(a/2)
s=alltrim(str(b))+s
enddo
?"转换为二进制为:",s

6、
clear
input "请输入x的值:" to x
if x>=20
if x>20
y=2*x+5
else
y=8
endif
else
y=10*x-5
endif
?"y=",y

7、
clear
e=1
m=1
do while m>=0.000001
k=1
for j=1 to i
k=k*j
endfor
m=1/k
e=e+m
endfor
?"e=1+1/1!+1/2!+1/3!+...+1/n!=",e

8、数据库建立自理

9、clear
dime a(3)
for i=1 to 3
input "请输入一个整数:" to a(i)
endfor
?"从大到小排序后为:"
for i=1 to 2
for j=i+1 to 3
if a(j)>a(i)
k=a(i)
a(i)=a(j)
a(j)=k
endif
endfor
??alltrim(str(a(i)))+space(3)
endfor
??alltrim(str(a(i)))

10、
clear
a=1
b=2
??a,b
FOR n=1 TO 18
c=a+b
a=b
b=c
??c
endf


vf编程题
clear accept "请输入一个字符串(字符串只包含字母和*号):" to zf input "请输入字符串尾部*号个数:" to n l=len(zf)s=0 for i=l to 1 step -1 k=substr(zf,i,1)if k="*"s=s+1 else exit endif endfor if s>n zf1=left(zf,l-(s-n))else zf1=zf endif ?"字符...

VF编程题:求100以内所有能被3整除的整数的和
clear s=0 for i=1 to 100 if i%3=0 s=s+i endif endfor ?"100以内所有能被3整除的整数的和是:",s

10道编程题、、VF高手进啊、、急急急!!!高分!!!
clear text 一元二次方程求解 ax^2+bx+c=0 endtext input "请输入a的值:" to a input "请输入b的值:" to b input "请输入c的值:" to c m=b*b-4*a*c if m>=0 x1=(-b+sqrt(m))\/(2*a)x2=(-b-sqrt(m))\/(2*a)?"x1的值是:",x1 ?"x2的值是:",x2 else ?

vf 编程题,求详解,一步一步的最好,题在下头, 高手请耐心详解哈。_百度...
for i=1 to 3 变量i从1到3循环 ?space(20-i) 每一行产生20-i个空格(当i=1时,为19个空格;i=2时,为18个;i=3时,为17个)for j=1 to 2*i-1 变量j从1到2*i-1循环(当i=1时,2*i-1=1,循环1次;i=2时,2*i-1=3,循环3次;i=3时,2*i-1=5,循环5次...

各位帮忙解决几题VFP菜鸟级别编程题...
第一道题:set talk off clear input "请输入一个数" to m do while .t.if int(m\/3)=m\/3 a=m%10 if a=3 exit endif endif m=m+1 enddo ?"这个数是"+str(m,10)set talk on return 第二道题:set talk off clear input "请输入你想比较的数的个数: " to n dimen a(n)...

求问大家一道VF的编程题
1、index on 数学 desc to sx 2、index on 综合成绩 desc to zh 3、sele score go top do while not eof()if 数学>90 disp 学号,姓名,性别,数学 endif if not eof()skip 1 endif enddo retu 4、sele score go top scan for 综合成绩<80 disp 学号,姓名,性别,综合成绩 endscan ...

VF的几道简单题~答对了还有加分~
第一题:set talk off clear for i= 100 to 2000 a=int(i\/1000)b=int((i-a*1000)\/100)c=int((i-a*1000-b*100)\/10)d=mod(i,10)if a^3+b^3+c^3+d^3=i ? i endif next set talk on 第2题:set talk off s1=0 for i= 1000 to 9999 step 2 a=int(i\/1000)b=int...

vf初级编程题,,输入10个数,求这10个数最大值,并求出这个最大值...
clear DIMENSION a(10)FOR i=1 TO 10 input "共输入10个数,你输入第"+ALLTRIM(STR(i))+"个数是:" to a(i)ENDFOR FOR i=1 TO 9 FOR j=1 TO 9 IF a(j)

VF编程题,已知数列{f(n)}:f(1)=1,f(2)=4,当n>2时,f(n)=3*f(n-2)-f...
SET TALK OFF CLEAR DIMENSION f[20]f[1]=1 f[2]=4 zsx=f[1]+f[2]FOR n=3 TO 20 f[n]=3*f[n-2]-f[n-1]IF f[n]>0 zsx=zsx+f[n]ENDIF ENDFOR ?zsx SET TALK ON

VF编程题:从键盘输入10个数到数组a(10)中,显示数组中所有元素值_百度知 ...
dimension a(3,4)s=0 for m=1 to 3 for n=1 to 4 input "请输入第”+str(m,1)+"行第”+str(n,1)+"列数据:" to a(m,n)s=s+a(m,n)endfor endfor ?"所有数组元素的累加和是",s

中沙群岛的岛礁及其海域15239177265: 请帮我用VF做几道编程的题!越详细越好!拜托了! -
其菡脑安: 1.modify commond main.prg for i=1 to 100 s=sqrt(i) strtofile[str(x,10,7),'result.c',.t.} endfor 我只会这个``哈哈.

中沙群岛的岛礁及其海域15239177265: VF编程题:求100以内所有能被3整除的整数的和 -
其菡脑安: clear s=0 for i=1 to 100 if i%3=0 s=s+i endif endfor?"100以内所有能被3整除的整数的和是:",s

中沙群岛的岛礁及其海域15239177265: 编程 vf语言 简单题目,求高手写一下程序,谢谢啦!在线,快速采纳!!!!!!!!!!! -
其菡脑安: set talk off clear for i=1 to 99m=i*iif i<10n=mod(m,10)elsen=mod(m,100)endif if n=i? i endifend for set talk on

中沙群岛的岛礁及其海域15239177265: 关于VF编程的一道题,请各位编程高手帮忙解决下.谢谢!题目如下: -
其菡脑安: clearinput "请输入第一个数:" to ac=afor i=1 to 4 input "请再输入一个数:" to b if a<b a=b endif if c>b c=b endifendfor?"最大数是:",a?"最小数是:",c

中沙群岛的岛礁及其海域15239177265: VF编程题 -
其菡脑安: * 求最大及最小 local arr, i, max, min, k dime arr(10) i=10 do while i>0 input to arr[i] i = i-1 enddo i=10 min = arr[1] max = arr[1] do while i>0 if max max = arr[i] endif if min>arr[i]min = arr[i] endif i=i-1 enddo?"最大数: ", max?"最小数:", min

中沙群岛的岛礁及其海域15239177265: VF的程序设计题,急!!!!高手帮帮忙啊! -
其菡脑安: ①编一过程用于求一元二次方程的两个实根,要求主程序实现输入和输出的功能.set talk offstore 0 to x1,x2input "a=" to ainput "b=" to binput "c=" to cif fun(a,b,c)>=0 ? x1,x2else messagebox("无实数解!")endifreturnfunction fun(a,b,...

中沙群岛的岛礁及其海域15239177265: 急求高手解答vf数据库操作题(写出命令)
其菡脑安: 1.select 姓名,工资 from ZGDA where 性别='女' and 婚否='是';2.update 工资=工资+300 from ZGDA where 工资<1600 update 工资=工资+500 from ZGDA where 工资>1600 OR 工资=16003.delete from ZGDA where colum=84.select 姓名,工资 from ZGDA order by 工资 desc5.select * from ZGDA where 姓名='王明'

中沙群岛的岛礁及其海域15239177265: vf 编程题: -
其菡脑安: stor 0 to s,t for i=1 to 20 t=t+i s=s+t endfor ?s

中沙群岛的岛礁及其海域15239177265: VF练习题,会写的来帮忙 -
其菡脑安: 1, select xsdadisplay for 性别='女' fields 姓名,学号,性别2,select xsdago 4deletepack3,select xsdareplace 语文 with 语文+10 for 性别='男'4,select xsdaindex on 学号...

中沙群岛的岛礁及其海域15239177265: 求问一道vf的编程题,已知x,y,z为正整数x^2+y^2+z^2=35^2求x+y+z最大值 -
其菡脑安: 已知x,y,z为正整数 x^2+y^2+z^2=35^2 求x+y+z最大值用计算机的好处就是速度快,一个一个试就行. 首先确定x,y,z的最大值和最小值, 最小值是1, x的最大值就是,假如yz都是最小值1,那么x就是34.97,取整34 yz的和x一样,都是1-34 参考代码如下: clear s=0 for x=1 to 34 for y=1 to 34 for z=1 to 34 if x^2+y^2+z^2=35^2 n=x+y+z if n>s s=n endif endif endfor endfor endfor ?'x+y+z的最大值为',s

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网