1. Trang chủ
  2. » Giáo án - Bài giảng

Bài 14: Mảng hai chiều

7 198 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 7
Dung lượng 0,92 MB

Nội dung

Bµi 14   A     !"# $%&'  ()* +),%-* !"# ./0123.4(* 7935 3829 6741 1 2 3 4 1 2 3   5637833 !"#$%&'()**+,&'-./012&'-./34$&'(5 6*$0.7(8$%&'(5 690:8 !"#;)**+,<2<34==*5 6*>8;5 563$839 6*$?.7(8**+,'-./012&'-./34$&'(5  6*>2;8**+,@2A@34*=5 690:8 6*;8**+,<2<34==*5 ABC9* 1. :;<=>?@<=>? Write(‘ Nhap vao so dong, cot:’); Readln(n,m); $ :;@3A23 ) >  ? For i:= 1 to n do For j:=1 to m do Begin write(‘A[’,i,j,’ ] = ’ ); readln(A[i,j]); end; C¸c bíc: ThÓ hiÖn b»ng pascal  :;)B A 1 2 3 4 1 2 3 7935 3829 6741 8 C)B Writeln(‘ Mang vua nhap : ’); For i:=1 to n do Begin For j:=1 to m do Write(A[i,j],’ ’); Writeln; end; Mang vua nhap: 1 4 7 6 9 2 8 3 5 3 9 7 1. D83 2. C3A23 E)@F BC9DE0FGFOR do H For i :=1 to 9 do For j:=1 to 9 do A[i,j] := i*j;  633G0"H3 VÝ dô: TÝnh vµ in ra mµn h×nh b¶ng cöu ch¬ng. For i :=1 to 9 do Begin For j:=1 to 9 do write(A[i,j]:5); writeln; writeln; End; IJ4K3LM4 NOF @P 8@3"# QR 1 2 3 4 5 6 7 8 9 2 4 6 8 10 12 14 16 18 3 6 9 12 15 18 21 24 27 4 8 12 16 20 24 28 32 36 5 10 15 20 25 30 35 40 45 6 12 18 24 30 36 42 48 54 7 14 21 28 35 42 49 56 63 8 12 24 32 40 48 56 68 72 9 18 27 36 45 54 63 72 81 * TÝnh * IN ra mµn h×nh Quan s¸t b¶ng cöu ch¬ng ta thÊy: A[2,5]=2 x 5 = 10 A[5,8]=5 x 8 = 40 A[i,j]=i*j H·y nhí ! +)B0@)B@ S   2  0T 0@ )  B  8()H.P<= H.P<=H.   78 (8)<< 3G0"NKUVW J01XYZ [Y0, … 15 20 19 16 25 18 17 12 16 Var A:ARRAY[1 10,1 10] OF integer; A[1,3] = 19

Ngày đăng: 25/01/2015, 09:00

TỪ KHÓA LIÊN QUAN

w