Chắc suất Đại học top - Giữ chỗ ngay!! ĐĂNG BÀI NGAY để cùng trao đổi với các thành viên siêu nhiệt tình & dễ thương trên diễn đàn.
Program NO_NAME;
Uses Crt;
Var
i,j,k,x,y,b,c1,c2,c3,c4,c5,,,,c9,c10,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,cot,hang: Integer;
a: Array[1..10,1..10] Of Integer;
Procedure BOARD;
Begin
k := 1;
Writeln(' | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 |');
Writeln('===|=====================================================================|');
Repeat
Writeln(' ' ,k, ' | | | | | | | | | | |');
Writeln(' | | | | | | | | | | |');
k := k+1;
Until k=10;
Writeln('10 | | | | | | | | | | |');
Writeln('==========================================================================');
Writeln('TT | | | | | | | | | | |');
Writeln('==========================================================================');
End;
//===================================================================
Function check(hang,cot:Integer): Boolean;
Begin
If (hang<1) Or (cot<1) Or (hang>10) Or (cot>10) Then
check := False
Else check := True;
End;
//===================================================================
Procedure ENTER2;
Begin
Write('NHAP SO CUA A[',x,',',y,']: ');
Readln(a[x,y]);
End;
//===================================================================
Procedure ENTER1;
Begin
Write('NHAP SO HANG CUA MANG: ');
Readln(hang);
Write('NHAP SO COT CUA MANG: ');
Readln(cot);
If check(hang,cot)=False Then
Begin
Repeat
Textcolor(lightred);
Writeln;
Writeln('ERROR!');
Delay(500);
Clrscr;
Textcolor(white);
Write('NHAP LAI SO HANG: ');
Readln(hang);
Write('NHAP LAI SO COT: ');
Readln(cot);
Until check(hang,cot)=True;
End;
If check(hang,cot)=True Then
Begin
Clrscr;
Writeln('NHAP SO PHAI IT HON 9999 VA LON HON -9999!');
Writeln('==========================================');
Delay(750);
For x:=1 To hang Do
Begin
For y:=1 To cot Do
Begin
ENTER2;
End;
End;
End
End;
//===================================================================
Procedure APPEARENCE;
Begin
For x:=1 To hang Do
Begin
For y:=1 To cot Do
Begin
Gotoxy(6 + (x-1)*7, 3 + (y-1)*2 );
Textcolor(yellow);
Writeln(a[x,y]);
End;
End;
End;
//===================================================================
Procedure TOTALCOLUMN1;
Begin
s1 := a[1,1]+a[1,2]+a[1,3]+a[1,4]+a[1,5]+a[1,6]+a[1,7]+a[1,8]+a[1,9]+a[1,10];
Gotoxy(6,23);
Writeln(s1);
End;
//===================================================================
Procedure TOTALCOLUMN2;
Begin
s2 := a[2,1]+a[2,2]+a[2,3]+a[2,4]+a[2,5]+a[2,6]+a[2,7]+a[2,8]+a[2,9]+a[2,10];
Gotoxy(13,23);
Writeln(s2);
End;
//===================================================================
Procedure TOTALCOLUMN3;
Begin
s1 := a[3,1]+a[3,2]+a[3,3]+a[3,4]+a[3,5]+a[3,6]+a[3,7]+a[3,8]+a[3,9]+a[3,10];
Gotoxy(20,23);
Writeln(s3);
End;
//===================================================================
Procedure TOTALCOLUMN4;
Begin
s4 := a[4,1]+a[4,2]+a[4,3]+a[4,4]+a[4,5]+a[4,6]+a[4,7]+a[4,8]+a[4,9]+a[4,10];
Gotoxy(27,23);
Writeln(s4);
End;
//===================================================================
Procedure TOTALCOLUMN5;
Begin
s5 := a[5,1]+a[5,2]+a[5,3]+a[5,4]+a[5,5]+a[5,6]+a[5,7]+a[5,8]+a[5,9]+a[5,10];
Gotoxy(34,23);
Writeln(s5);
End;
//===================================================================
Procedure TOTALCOLUMN6;
Begin
s6 := a[6,1]+a[6,2]+a[6,3]+a[6,4]+a[6,5]+a[6,6]+a[6,7]+a[6,8]+a[6,9]+a[6,10];
Gotoxy(41,23);
Writeln(s6);
End;
//===================================================================
Procedure TOTALCOLUMN7;
Begin
s7 := a[7,1]+a[7,2]+a[7,3]+a[7,4]+a[7,5]+a[7,6]+a[7,7]+a[7,8]+a[7,9]+a[7,10];
Gotoxy(48,23);
Writeln(s7);
End;
//===================================================================
Procedure TOTALCOLUMN8;
Begin
s8 := a[8,1]+a[8,2]+a[8,3]+a[8,4]+a[8,5]+a[8,6]+a[8,7]+a[8,8]+a[8,9]+a[8,10];
Gotoxy(55,23);
Writeln(s8);
End;
//===================================================================
Procedure TOTALCOLUMN9;
Begin
s9 := a[9,1]+a[9,2]+a[9,3]+a[9,4]+a[9,5]+a[9,6]+a[9,7]+a[9,8]+a[9,9]+a[9,10];
Gotoxy(62,23);
Writeln(s9);
End;
//===================================================================
Procedure TOTALCOLUMN10;
Begin
s10 := a[10,1]+a[10,2]+a[10,3]+a[10,4]+a[10,5]+a[10,6]+a[10,7]+a[10,8]+a[10,9]+a[10,10];
Gotoxy(69,23);
Writeln(s10);
End;
//===============================START=THE=MAIN=PROGRAM====================================//
Begin
Textbackground(black);
ENTER1;
Delay(1000);
Clrscr;
Begin
BOARD;
Delay(750);
APPEARENCE;
Delay(500);
Textcolor(lightred);
TOTALCOLUMN1;
TOTALCOLUMN2;
TOTALCOLUMN3;
TOTALCOLUMN4;
TOTALCOLUMN5;
TOTALCOLUMN6;
TOTALCOLUMN7;
TOTALCOLUMN8;
TOTALCOLUMN9;
TOTALCOLUMN10;
End;
Readln;
End.
Uses Crt;
Var
i,j,k,x,y,b,c1,c2,c3,c4,c5,,,,c9,c10,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,cot,hang: Integer;
a: Array[1..10,1..10] Of Integer;
Procedure BOARD;
Begin
k := 1;
Writeln(' | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 |');
Writeln('===|=====================================================================|');
Repeat
Writeln(' ' ,k, ' | | | | | | | | | | |');
Writeln(' | | | | | | | | | | |');
k := k+1;
Until k=10;
Writeln('10 | | | | | | | | | | |');
Writeln('==========================================================================');
Writeln('TT | | | | | | | | | | |');
Writeln('==========================================================================');
End;
//===================================================================
Function check(hang,cot:Integer): Boolean;
Begin
If (hang<1) Or (cot<1) Or (hang>10) Or (cot>10) Then
check := False
Else check := True;
End;
//===================================================================
Procedure ENTER2;
Begin
Write('NHAP SO CUA A[',x,',',y,']: ');
Readln(a[x,y]);
End;
//===================================================================
Procedure ENTER1;
Begin
Write('NHAP SO HANG CUA MANG: ');
Readln(hang);
Write('NHAP SO COT CUA MANG: ');
Readln(cot);
If check(hang,cot)=False Then
Begin
Repeat
Textcolor(lightred);
Writeln;
Writeln('ERROR!');
Delay(500);
Clrscr;
Textcolor(white);
Write('NHAP LAI SO HANG: ');
Readln(hang);
Write('NHAP LAI SO COT: ');
Readln(cot);
Until check(hang,cot)=True;
End;
If check(hang,cot)=True Then
Begin
Clrscr;
Writeln('NHAP SO PHAI IT HON 9999 VA LON HON -9999!');
Writeln('==========================================');
Delay(750);
For x:=1 To hang Do
Begin
For y:=1 To cot Do
Begin
ENTER2;
End;
End;
End
End;
//===================================================================
Procedure APPEARENCE;
Begin
For x:=1 To hang Do
Begin
For y:=1 To cot Do
Begin
Gotoxy(6 + (x-1)*7, 3 + (y-1)*2 );
Textcolor(yellow);
Writeln(a[x,y]);
End;
End;
End;
//===================================================================
Procedure TOTALCOLUMN1;
Begin
s1 := a[1,1]+a[1,2]+a[1,3]+a[1,4]+a[1,5]+a[1,6]+a[1,7]+a[1,8]+a[1,9]+a[1,10];
Gotoxy(6,23);
Writeln(s1);
End;
//===================================================================
Procedure TOTALCOLUMN2;
Begin
s2 := a[2,1]+a[2,2]+a[2,3]+a[2,4]+a[2,5]+a[2,6]+a[2,7]+a[2,8]+a[2,9]+a[2,10];
Gotoxy(13,23);
Writeln(s2);
End;
//===================================================================
Procedure TOTALCOLUMN3;
Begin
s1 := a[3,1]+a[3,2]+a[3,3]+a[3,4]+a[3,5]+a[3,6]+a[3,7]+a[3,8]+a[3,9]+a[3,10];
Gotoxy(20,23);
Writeln(s3);
End;
//===================================================================
Procedure TOTALCOLUMN4;
Begin
s4 := a[4,1]+a[4,2]+a[4,3]+a[4,4]+a[4,5]+a[4,6]+a[4,7]+a[4,8]+a[4,9]+a[4,10];
Gotoxy(27,23);
Writeln(s4);
End;
//===================================================================
Procedure TOTALCOLUMN5;
Begin
s5 := a[5,1]+a[5,2]+a[5,3]+a[5,4]+a[5,5]+a[5,6]+a[5,7]+a[5,8]+a[5,9]+a[5,10];
Gotoxy(34,23);
Writeln(s5);
End;
//===================================================================
Procedure TOTALCOLUMN6;
Begin
s6 := a[6,1]+a[6,2]+a[6,3]+a[6,4]+a[6,5]+a[6,6]+a[6,7]+a[6,8]+a[6,9]+a[6,10];
Gotoxy(41,23);
Writeln(s6);
End;
//===================================================================
Procedure TOTALCOLUMN7;
Begin
s7 := a[7,1]+a[7,2]+a[7,3]+a[7,4]+a[7,5]+a[7,6]+a[7,7]+a[7,8]+a[7,9]+a[7,10];
Gotoxy(48,23);
Writeln(s7);
End;
//===================================================================
Procedure TOTALCOLUMN8;
Begin
s8 := a[8,1]+a[8,2]+a[8,3]+a[8,4]+a[8,5]+a[8,6]+a[8,7]+a[8,8]+a[8,9]+a[8,10];
Gotoxy(55,23);
Writeln(s8);
End;
//===================================================================
Procedure TOTALCOLUMN9;
Begin
s9 := a[9,1]+a[9,2]+a[9,3]+a[9,4]+a[9,5]+a[9,6]+a[9,7]+a[9,8]+a[9,9]+a[9,10];
Gotoxy(62,23);
Writeln(s9);
End;
//===================================================================
Procedure TOTALCOLUMN10;
Begin
s10 := a[10,1]+a[10,2]+a[10,3]+a[10,4]+a[10,5]+a[10,6]+a[10,7]+a[10,8]+a[10,9]+a[10,10];
Gotoxy(69,23);
Writeln(s10);
End;
//===============================START=THE=MAIN=PROGRAM====================================//
Begin
Textbackground(black);
ENTER1;
Delay(1000);
Clrscr;
Begin
BOARD;
Delay(750);
APPEARENCE;
Delay(500);
Textcolor(lightred);
TOTALCOLUMN1;
TOTALCOLUMN2;
TOTALCOLUMN3;
TOTALCOLUMN4;
TOTALCOLUMN5;
TOTALCOLUMN6;
TOTALCOLUMN7;
TOTALCOLUMN8;
TOTALCOLUMN9;
TOTALCOLUMN10;
End;
Readln;
End.