Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses crt;
- var
- a:array [1..100,1..100] of integer;
- r,c,w,h,count,x,S:integer;
- function max:integer;
- begin
- max:=a[r,1];
- for c:=1 to w do
- if a[r,c]>max then max:=a[r,c];
- end;
- begin
- {
- a (array);
- r (row:Dong);
- c (column:Cot);
- w (width:Chieu ngang);
- h (height:Chieu cao);
- S: (Sum: Tong);
- }
- clrscr;
- write('Nhap so dong: ');
- readln(h);
- write('Nhap so cot: ');
- readln(w);
- write('Nhap so can tim: ');
- readln(x);
- for r:=1 to h do
- for c:=1 to w do
- begin
- write('a[',r,',',c,']= ');
- readln(a[r,c]);
- if a[r,c]=x then inc(count);
- end;
- writeln('Co ',count,' so bang ',x,' trong mang vua nhap');
- S:=0;
- for r:=1 to h do
- S:=S+max;
- writeln('Tong can tim la: ',s);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement