vfp编程
‘壹’ VFP怎么编程
ABC和BAC 就认为是重复吗?
‘贰’ vfp编程。。数字程序
for i=100 to 999
a=FLOOR(i/100)
b=FLOOR((i-a*100)/10)
c=mod(i,10)
if a*a*a+b*b*b+c*c*c=i
?i
endif
endfor
‘叁’ vfp编程,求编程
#include <iostream>
using namespace std;
class Coordinate
{
// 友元函数
friend void display(Coordinate &coor);
public:
Coordinate(int x, int y)
{
m_iX = x;
m_iY = y;
}
public:
int m_iX;
int m_iY;
};
void display(Coordinate &coor)
{
cout << "m_iX:" << coor.m_iX << endl;
cout << "m_iY:" << coor.m_iY << endl;
}
int main(void)
{
Coordinate coor(1,2);
display(coor);
return 0;
}
‘肆’ vfp程序编程
1
set talk off
clear
i=10
do while .t.
j=i*i-168
if j>0 then
k=sqrt(j)
if k=int( k) then
?k-100
exit
endif
endif
i=i+1
enddo
set talk on
return
2由于题目不需要输入年,所以程序没有判断润年的情况,2月天数设为28
set talk off
clear
dime mon(12)
mon(1)=31
mon(2)=28
mon(3)=31
mon(4)=30
mon(5)=31
mon(6)=30
mon(7)=31
mon(8)=31
mon(9)=30
mon(10)=31
mon(11)=30
mon(12)=31
INPUT "请输入月份:" TO m1
INPUT "请输入天数:" TO d1
s=0
for i=1 to m1-1
s=s+mon(i)
next
?s+d1
set talk on
return
3
set talk off
clear
dime a(3)
input "x=" to a(1)
input "y=" to a(2)
input "z=" to a(3)
for i=1 to 2
for j=i+1 to 3
if a(i)>a(j) then
t=a(i)
a(i)=a(j)
a(j)=t
endif
next j
next i
?a(1),a(2),a(3)
set talk on
return
‘伍’ VFP怎么编程
clear
dime a(10)
for i=1 to 10
input to a(i)
endfor
max=a(1)
min=a(1)
for i=2 to 10
if max<a(i)
max=a(i)
endif
if min>a(i)
min=a(i)
endif
endfor
"10个数中最大数为:",max
"10个数中最i小数为:",min
return
‘陆’ 关于VFP编程……
1、
**计算S=1-2+3-4……-100
clear
s=0
for i=1 to 100
if mod(i,2)<>0
s=s+i
else
s=s-i
endif
endfor
?"S=1-2+3-4……-100的结果为:",s
2、
**输出1到100以内能被3整除不能被5整除得整数
clear
for i=1 to 100
if mod(i,3)=0.and.mod(i,5)<>0
?i
endif
endfor
‘柒’ 关于VFP编程:1!+3!+5!+...+N!
将accept改成INPUT就行了
我样:
INPUT "请输入一个数:"to n
‘捌’ VFP编程序。。。。
input '请输入一个整数:" to s
?iif(mod(s,3)=0,s*3,"“该数不能被三整除")
input '请输入一个整数(1-9):" to s
do case
case s=1
?'one'
case s=2
?'two'
........中间自己加
case s=9
?'nine'
endcase
i=1
s=0
do while i<=100
s=s+1/i
i=i+1
enddo
?s
s=0
for i=1 to 100
s=s+1/i
endfor
?s
‘玖’ VFP编程序,懂VFP的来!
Input 'Please type the first number : ' to a
Input 'Please type the second number : ' to b
Input 'Please type the third number : ' to c
Input 'Please type the fourth number : ' to d
Input 'Please type the fifth number : ' to e
Return Iif(a/2=int(a/2),a,0)+Iif(b/2=int(b/2),b,0)+Iif(c/2=int(c/2),c,0)+Iif(d/2=int(d/2),d,0)+Iif(e/2=int(e/2),e,0)
&& Save the text to file p4.prg
‘拾’ vfp 就是编程吗
VFP准确的是数据库管理,它支持结构化编程和面向对象编程,它应该说还不算专业的程序设计软件,主要是管理数据库。