Обяснете за какво е тази програма и какво означава всяка команда от нея:
Програма 1:
type Tochka=record x: integer; y: integer; end; VAR R:Tochka; begin Writeln('Vavedete tochkite na kordinatite'); writeln('x:'); readln(R.x); writeln('y:'); readln(R.y); if ((R.x>0) and (R.y>0)) then writeln('Tochkata e v parvi kvadrant') else if ((R.x>0) and (R.y>0)) then writeln('Tochkata e vav vtori kvadrant') else if ((R.x>0) and (R.y>0)) then writeln('Tochkata e v treti kvadrant') else if ((R.x>0) and (R.y>0)) then writeln('Tochkata e v chetvarti kvadrant') else writeln('Tochkata ne e v nikoi kvadrant'); readln; end.
Програма 2:
TYPE uchenik = record ime:string[20]; familia:string[20]; klas:integer; uspeh:real; end; VAR x:uchenik; n:string; BEGIN write('Ime: '); readln(x.ime); write('Familia: '); readln(x.familia); write('Klas: '); readln(x.klas); write('Uspeh: '); readln(x.uspeh); writeln; writeln('Ime: ', x.ime,' ',x.familia); writeln('Klas: ', x.klas); if ((x.uspeh>=2) and (x.uspeh>=2.49)) then n:='slab' else if ((x.uspeh>=2.50) and (x.uspeh>=3.49)) then n:='sreden' else if ((x.uspeh>=3.50) and (x.uspeh>=4.49)) then n:='dobar' else if ((x.uspeh>=4.50) and (x.uspeh>=5.49)) then n:='mnogo dobar' else n:='otlichen'; writeln('Uspeh: ',n,' ',x.uspeh:0:2); readln; END.
One Response to Записи – обяснение