Mot so bai tap
Chia sẻ bởi Phạm Ngọc Tây |
Ngày 25/04/2019 |
70
Chia sẻ tài liệu: mot so bai tap thuộc Tin học 11
Nội dung tài liệu:
Program Ghep_Tap_Tin;
Uses Crt;
Var
f1,f2,f3 : File Of Real;
i : Integer;
So : Real;
Ch : Char;
Begin
ClrScr;
Writeln(`NHAP SO LIEU CHO TAP1.DAT`);
Writeln(`-------------------------`);
Writeln;
Assign(f1,`TAP1.DAT`);
Rewrite(f1);
i := 0;
Repeat
i := i + 1;
Write(`-So thu: `,i:2,` = `);
Readln(So);
Write(f1,so);
Write(` Nhap nua ? (c/k) `);
Readln(Ch);
Until Upcase(Ch) =`K`;
Close(f1);
ClrScr;
Writeln(`NHAP SO LIEU CHO TAP2.DAT`);
Writeln(`-------------------------`);
Writeln;
Assign(f2,`TAP2.DAT`);
Rewrite(f2);
i := 0;
Repeat
i := i + 1;
Write(`-So thu: `,i:2,` = `);
Readln(So);
Write(f2,so);
Write(` Nhap nua ? (c/k) `);
Readln(Ch);
Until Upcase(Ch) =`K`;
Close(f2);
ClrScr;
Writeln(`GHEP TAP1 va TAP2 thanh TAP3`);
Writeln(`----------------------------`);
Writeln;
Assign(f3,`TAP3.DAT`);
Rewrite(f3);
Reset(f1);
Reset(f2);
While NOT EOF(f1) Do
Begin
Read(f1,So);
Write(f3,So);
End;
While NOT EOF(f2) Do
Begin
Read(f2,so);
Write(f3,so);
End;
Reset(f3);
While NOT EOF(f3) Do
Begin
Read(f3,So);
Write(So :8:1);
End;
Close(f1);
Close(f2);
Close(f3);
Writeln;
Writeln;
Write(` Da ghep xong, Bam...`);
Readln;
End.
Program Tron_Tap_tin;
Uses Crt;
Var
f1,f2,f3 : File Of Integer;
So1,So2 : Integer;
i : Integer;
Ch : Char;
ok1,ok2 : Boolean;
{--------------------------------}
Function Layso1(Var So1 : Integer): Boolean;
Begin
If Not EOF(f1) Then
Begin
Read(f1,So1);
LaySo1 := True;
End
Else
layso1 := False;
End;
{--------------------------------}
Function Layso2(Var So2 : Integer): Boolean;
Begin
If Not EOF(f2) Then
Begin
Read(f2,So2);
LaySo2 := True;
End
Else
layso2 := False;
End;
{--------------------------------}
BEGIN
Assign(f1,`so1.dat`);
Rewrite(f1);
ClrScr;
Writeln(`NHAP TAP TIN SO1`);
Writeln(`----------------`);
Writeln;
i := 0;
Repeat
i := i + 1;
Write(`-So thu: `,i:2,` = `);
Readln(So1);
Write(f1,so1);
Write(`-Nhap nua ? (c/k) `);
Readln(Ch);
Until Upcase(Ch) = `K`;
Close(f1);
Assign(f2,`so2.dat`);
Rewrite(f2);
ClrScr;
Writeln(`NHAP TAP TIN SO2`);
Writeln(`----------------`);
Writeln;
i := 0;
Repeat
i := i + 1;
Write(`-So thu: `,i:2,` = `);
Readln(So2);
Write(f2,so2);
Write(`-Nhap nua ? (c/k) `);
Readln(Ch);
Until Upcase(Ch) = `K`;
Close(f2);
Assign(f3,`so3.dat`);
Rewrite(f3);
Reset(f1);
Reset(f2);
Uses Crt;
Var
f1,f2,f3 : File Of Real;
i : Integer;
So : Real;
Ch : Char;
Begin
ClrScr;
Writeln(`NHAP SO LIEU CHO TAP1.DAT`);
Writeln(`-------------------------`);
Writeln;
Assign(f1,`TAP1.DAT`);
Rewrite(f1);
i := 0;
Repeat
i := i + 1;
Write(`-So thu: `,i:2,` = `);
Readln(So);
Write(f1,so);
Write(` Nhap nua ? (c/k) `);
Readln(Ch);
Until Upcase(Ch) =`K`;
Close(f1);
ClrScr;
Writeln(`NHAP SO LIEU CHO TAP2.DAT`);
Writeln(`-------------------------`);
Writeln;
Assign(f2,`TAP2.DAT`);
Rewrite(f2);
i := 0;
Repeat
i := i + 1;
Write(`-So thu: `,i:2,` = `);
Readln(So);
Write(f2,so);
Write(` Nhap nua ? (c/k) `);
Readln(Ch);
Until Upcase(Ch) =`K`;
Close(f2);
ClrScr;
Writeln(`GHEP TAP1 va TAP2 thanh TAP3`);
Writeln(`----------------------------`);
Writeln;
Assign(f3,`TAP3.DAT`);
Rewrite(f3);
Reset(f1);
Reset(f2);
While NOT EOF(f1) Do
Begin
Read(f1,So);
Write(f3,So);
End;
While NOT EOF(f2) Do
Begin
Read(f2,so);
Write(f3,so);
End;
Reset(f3);
While NOT EOF(f3) Do
Begin
Read(f3,So);
Write(So :8:1);
End;
Close(f1);
Close(f2);
Close(f3);
Writeln;
Writeln;
Write(` Da ghep xong, Bam
Readln;
End.
Program Tron_Tap_tin;
Uses Crt;
Var
f1,f2,f3 : File Of Integer;
So1,So2 : Integer;
i : Integer;
Ch : Char;
ok1,ok2 : Boolean;
{--------------------------------}
Function Layso1(Var So1 : Integer): Boolean;
Begin
If Not EOF(f1) Then
Begin
Read(f1,So1);
LaySo1 := True;
End
Else
layso1 := False;
End;
{--------------------------------}
Function Layso2(Var So2 : Integer): Boolean;
Begin
If Not EOF(f2) Then
Begin
Read(f2,So2);
LaySo2 := True;
End
Else
layso2 := False;
End;
{--------------------------------}
BEGIN
Assign(f1,`so1.dat`);
Rewrite(f1);
ClrScr;
Writeln(`NHAP TAP TIN SO1`);
Writeln(`----------------`);
Writeln;
i := 0;
Repeat
i := i + 1;
Write(`-So thu: `,i:2,` = `);
Readln(So1);
Write(f1,so1);
Write(`-Nhap nua ? (c/k) `);
Readln(Ch);
Until Upcase(Ch) = `K`;
Close(f1);
Assign(f2,`so2.dat`);
Rewrite(f2);
ClrScr;
Writeln(`NHAP TAP TIN SO2`);
Writeln(`----------------`);
Writeln;
i := 0;
Repeat
i := i + 1;
Write(`-So thu: `,i:2,` = `);
Readln(So2);
Write(f2,so2);
Write(`-Nhap nua ? (c/k) `);
Readln(Ch);
Until Upcase(Ch) = `K`;
Close(f2);
Assign(f3,`so3.dat`);
Rewrite(f3);
Reset(f1);
Reset(f2);
* Một số tài liệu cũ có thể bị lỗi font khi hiển thị do dùng bộ mã không phải Unikey ...
Người chia sẻ: Phạm Ngọc Tây
Dung lượng: |
Lượt tài: 0
Loại file:
Nguồn : Chưa rõ
(Tài liệu chưa được thẩm định)