vb语言能干嘛 vb编程。把1~100之间能被7整除的数添加到列表框
vb编程。把1~100之间能被7整除的数添加到列表框
vb编程。把1~100之间能被7整除的数添加到列表框
Private Sub Form_Load()
Dim i As Integer
For i = 1 To 100
If (i Mod 7 = 0) Then
Combo1.AddItem i
End If
Next
End Sub
输入两个数m,n,求这两个数之间能被2整除的数,并添加到列表框中 用delphi语言.
我答的呢,怎么没有了,写了好长时间呀
首先,创建一个窗体,在上面放置两个EDit控件,EDIT 只允许输入整数。
var
m, n : integer;
放置一个button 一个label.
var
iMAX, iMin, i ; integer;
begin
m := StrToint(edit1.txt);
n := StrToint(edi2.txt);
if (m > n)
{
iMax := ((m - 1) div 2) * 2;
iMin := ((n + 1) div 2)* 2;
}
else
{
iMax := ((n - 1) div 2) * 2;
iMin := ((m + 1) div 2)* 2;
}
label1.caption := '被2 整除的数有:';
for i := iMin to iMAX do
begin label1.caption := label1.caption + IntTostr(i) + ', ';
i ;= i + 1;
end;
end;
用delphi语言.输入两个数m,n,求这两个数之间能被2整除的数,并添加到列表框中
for i := m to n do
if i mod 2 = 0 then
ListBox1.Items.Add ( IntToStr(i));
在列表框中输出100~1000之间能被37整除的数。
111,148,185,
222,259,296,
333,370,
407,444,481,
518,555,592,
629,666,
703,740,777,
814,851,888,
925,962,999。
vb中 怎样使列表框1的项目添加到列表框2中
Private Sub Command2_Click()
For i = 0 To List1.ListCount - 1
List2.AddItem List1.List(i)
Next
End Sub 全部添加
Private Sub Command1_Click() 只添加选定的
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then List2.AddItem List1.List(i)
Next
End Sub
Private Sub Form_Load()
For i = 1 To 9
List1.AddItem i
Next
End Sub
delphi 程序题 输入两个数,求这两个数之间能被K(是一个整数)整除的数,并把这些数字添加到列表框里
procedure TForm1.btnOKClick(Sender: TObject);
var
v_Index,M,N,K:Integer;
begin
M := StrToIntDef(Edit1.Text,0); 起始数
N := StrToIntDef(Edit2.Text,0); 结束数
K := StrToIntDef(Edit3.Text, 1); K
ListBox1.Items.Clear; 先清空列表
for v_Index := M to N do 遍历M到N(含M和N)之间的所有整数
begin
if v_Index mod K = 0 then 能被K整除的数(即除以K余0的数)
begin
ListBox1.Items.Add(IntToStr(v_Index));
end;
end;
end;
VB高手帮忙:用inputbox输入n值,单击mand求1到n之间能被11整除的数的和。结果添加入列表框中
private sub mand1_click()
dim n as integer,i as integer,sum as integer
n=val(inputbox("input n=","data Input",11)
sum=0
for i=1 to n
if i mod 11 =0 then
sum=sum+i
end if
list1.additem n,list1.listindex+1
end sub
vb中怎样把文本框的文本添加到列表框
List1.AddItem Text1,0
最后一个数字指定位置

求300到500之间能被37整除的数字的vb编程
Dim a, b
Private Sub Form_Click()
b = 37
For a = 300 To 500
If a Mod b = 0 Then Print a
Next
End Sub
'取300到500之间的整数,除以37,余数为0就是整除
相关文章
- 程式和程序 程式设计程式 求500以内能被3和5同时整除的所有数的和,c语言程式码写全一点,谢谢啦
- c语言100以内的素数 c语言编程:连续输入若干个正整数,求其和及其平均值,直到输入0结束.
- 10乘10等于100的成语 四加五加九乘七加三加四五成语3等于多少
- 数控循环程序怎么编程 编C语言程序“编程计算1到50中是7的倍数的数值之和”,使用for循环语句。
- 1到100奇数的乘积编程 C语言中编程计算1至100以内的奇数和偶数并分别求和,求代码
- C语言求一千以内奇数和 C语言怎么算出100以内的奇数和奇数相加,偶数和偶数相加?过程请详细!
- 2的倍数有哪些 程式设计100以内所有7的倍数
- 编写程序从键盘输入10个整数 c语言 编写程式,从键盘输入一个整数,计算并输出它是几位数。若输入的是负数时,要求重新输入。
- 编写程序1加到100之和 C语言编写程序,求1-3+5-7+.-99+101的值 用while和for两种方法编写 计算机
- 含数字的成语一到十 带有数字的成语
爱学记

微信收款码
支付宝收款码