PROGRAM MARIOVERI ;
VAR i, j, k, t, ls, js, T1, T2, T3, T4, T5 : INTEGER;
mario : ARRAY [ 1..20, 1..20] of INTEGER;
veri, marioson : text;
BEGIN
ASSIGN(veri, 'C:\mario.txt');
RESET(veri);
ASSIGN (marioson, 'C:\mariosonuc.txt');
REWRITE(marioson);
FOR k:= 1 TO 20 DO
FOR t :=1 TO 20 DO
BEGIN
mario[k][t] := 0;
END;
READ(veri, js, ls);
FOR i:= 1 TO ls DO
BEGIN
FOR j:= 1 TO js DO
BEGIN
READ ( veri, mario[i][j]);
WRITE ( marioson, mario[i][j]);
END;
READLN(veri);
WRITELN(marioson);
END;
T1 := 0; T2 :=0; T3:=0; T4:=0; T5:=0;
FOR i := 1 TO ls DO
BEGIN
FOR j := 1 TO js DO
BEGIN
CASE mario[i][j] OF
1: T1 := T1+1;
2: T2 := T2+1;
3: T3 := T3+1;
4: T4 := T4+1;
5: T5 := T5+1;
END;
END;
END;
WRITELN (marioson,'Kac kere 1 kullanilmis:', T1:8);
WRITELN (marioson,'Kac kere 2 kullanilmis:', T2:8);
WRITELN (marioson,'Kac kere 3 kullanilmis:', T3:8);
WRITELN (marioson,'Kac kere 4 kullanilmis:', T4:8);
WRITELN (marioson,'Kac kere 5 kullanilmis:', T5:8);
CLOSE (marioson);
READLN;
END.
Hiç yorum yok:
Yorum Gönder