1樓:匿名使用者
option explicit
option base 1
dim a%(80), i%, k%, t%, b%(80)private sub command1_click()me.cls
dim j as integer
randomize
for i = 1 to 80
a(i) = int(rnd * 90) + 10next i
k = 0
t = 1
for i = 1 to 79
b(i) = abs(a(i + 1) - a(i))if b(i) > k then
k = b(i)
t = i
end if
next i
print "全部"
for i = 1 to 80
print a(i);
if i mod 10 = 0 then printnext i
print "最大差值:" & k & ",是" & a(t + 1) & "和" & a(t) & "之差"
end sub請參考
用隨機函式產生20個兩位數的整數,存於4行5列的二維陣列中
2樓:匿名使用者
#include
#include
using namespace std;
void main()
else}}
int imax = sz[0][0], imin = sz[0][0];
int imaxx, imaxy;
int iminx, iminy;
for (i=0;i<4;i++)
if (sz[i][j] < imin)
}cout << endl;
}cout << imax << "\t" << imaxx << "," << imaxy << endl;
cout << imin << "\t" << iminx << "," << iminy << endl;}
vb程式設計:產生20個10至100間的隨機整數存入一維陣列a中,每行5個元素輸出;定義一個4行5列的二維陣列
3樓:匿名使用者
private sub command1_click()dim a(20) as integer, b(4, 5) as integer
randomize
for i = 1 to 20
a(i) = int(rnd * 91) + 10print a(i);
if i mod 5 = 0 then printnext
for i = 1 to 4
for j = 1 to 5
b(i, j) = a(j + (i - 1) * 5)print b(i, j);
next
next
end sub
4樓:匿名使用者
private sub form_load()dim a(1 to 20) as integerdim b(1 to 4, 1 to 5) as integerdim j, i as integer
j = 1
for i = 1 to 20
randomize
a(i) = int(rnd() * 90) + 10next i
for i = 1 to 20
k = i mod 5
if k = 0 then k = 5
b(j, k) = a(i)
if i mod 5 = 0 then j = j + 1next i
print "a:"
for i = 1 to 20
print a(i),
if i mod 5 = 0 then print chr(13)next i
print "b:"
for i = 1 to 4
for j = 1 to 5
print b(i, j),
next j
next i
end sub
原創喲,臭美一下
5樓:匿名使用者
dim i as long,a(1 to 20) as longfor i=1 to 20
a(i)=cint(int((100- 10+ 1) * rnd() + 10))
next i
vb程式設計**:定義一個5×5的二維陣列,隨機產生25個兩位數(10,99)存於該二維陣列元素中,統
6樓:兄弟連教育北京總校
//#include "stdafx.h"//vc++6.0加上這一行.
#include "stdio.h"
#include "time.h"
#include "stdlib.h"
int main(void)
如果只計算
一條主對角線,則:
int main(void)
VB用exit do語句,產生隨機的兩位數,當偶數的個數為6的時候結束
private sub form click static i as integer static j as integer static k as integer k 0 j 0 me.cls randomize dok k 1 i rnd 90 10 mod 100me.print i if i...
用數卡38516編兩位數乘兩位數或兩位數乘三
柔情西瓜啊 1 兩位數乘兩位數 38 51 1938 35 61 2135 2 兩位數乘三位數 38 516 19608 63 185 11655 擴充套件資料 計算方法 1 使用鉛筆和紙張乘數的常用方法需要一個小數字 通常為0到9的任意兩個數字 的儲存或查詢產品的乘法表,但是一種農民乘法演算法的方...
請你用7,這數字按要求組成兩位數乘兩位數乘法算式 並用你喜歡的方法驗
用2 3 5 7這四個數字按要求組成兩位數乘兩位數的乘法算式有多種方法,比如 23 57 1311 23 57 161115 1311 驗算 交換兩個因數的位置 57 23 171114 1311 所以,23 57 1311 鄧敏樺 23 25 23 27 23 32 23 35 23 37 23 ...