SHARE
TWEET

Untitled

finalshare Dec 19th, 2016 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uses crt;
  2. var
  3.         a:array [1..100,1..100] of integer;
  4.         r,c,w,h,count,x,S:integer;
  5. function max:integer;
  6. begin
  7.         max:=a[r,1];
  8.         for c:=1 to w do
  9.                 if a[r,c]>max then max:=a[r,c];
  10. end;
  11.  
  12. begin
  13. {
  14.         a (array);
  15.         r (row:Dong);
  16.         c (column:Cot);
  17.         w (width:Chieu ngang);
  18.         h (height:Chieu cao);
  19.         S: (Sum: Tong);
  20. }
  21.         clrscr;
  22.         write('Nhap so dong: ');
  23.         readln(h);
  24.         write('Nhap so cot: ');
  25.         readln(w);
  26.         write('Nhap so can tim: ');
  27.         readln(x);
  28.  
  29.         for r:=1 to h do
  30.                 for c:=1 to w do
  31.                         begin
  32.                                 write('a[',r,',',c,']= ');
  33.                                 readln(a[r,c]);
  34.                                 if a[r,c]=x then inc(count);
  35.                         end;
  36.         writeln('Co ',count,' so bang ',x,' trong mang vua nhap');
  37.         S:=0;
  38.         for r:=1 to h do
  39.                 S:=S+max;
  40.         writeln('Tong can tim la: ',s);
  41.         readln;
  42. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top