Soal USB 2011 Live Coding


Waktu pengerjaan 30 Menit, outputnya diminta seperti dibawah ini:
Ketentuan Program:
1. Harus menggunakan perulangan untuk membuat bangun
2. Tampilan berletak center bisa menggunakan window atau gotoxy(x,y) **
Tips dan Trik cukup satu : BERDOA DAN KUAT MENTAL! hehehehe :D
NB: **optional


Berikut Source Code dari  Fauzi Online:
Program FINAL_USB_2011;
uses crt;
var batas,hor1,ver1,a,c:integer;
const x='+';
begin
clrscr;
batas:=5;
hor1:=20;
ver1:=5;

for a:=1 to batas do begin
        for c:=1 to a do begin
                hor1:=hor1-1;
                gotoxy(hor1,ver1);
                write(x);
        end;
        hor1:=20;
        inc(ver1);

end;

hor1:=44;
ver1:=5;
for a:=1 to batas do begin
        for c:=1 to a do begin
                hor1:=hor1+1;
                gotoxy(hor1,ver1);
                write(x);
        end;
        hor1:=44;
        inc(ver1);

end;

for a:=1 to batas do begin
//vertical
        gotoxy(22,4+a);write(x,x);
        gotoxy(26,4+a);write(x,x);

//horizontal
        gotoxy(21+a,9);write(x);
        gotoxy(29+a,5);write(x);
        gotoxy(29+a,7);write(x);
        gotoxy(29+a,9);write(x);
        gotoxy(36+a,5);write(x);
        gotoxy(36+a,7);write(x);
        gotoxy(36+a,9);write(x);
end;
for a:=1 to batas-2 do begin
//vertical kecil
        gotoxy(30,4+a); write(x,x);
        gotoxy(33,6+a); write(x,x);
        gotoxy(37,4+a); write(x,x);
        gotoxy(37,6+a); write(x,x);
end;
gotoxy(42,6);write(x);
gotoxy(42,8);write(x);
gotoxy(15,10);write(x,x,'Unlimited   Software   Building',x,x);

readln;
end.
Mohon doanya, agar bisa lebih maju yaah? AMIIN.. SEMANGAT!! Salam Fauzi Online... see youu ^__^

1 comment:

  1. Salam fauzi online

    USB disini singkatan apa ya?

    just curious

    ReplyDelete