Darmowe Forum
Maj 04, 2024, 14:28:27 *
Witamy, Gość. Zaloguj się lub zarejestruj.
Czy dotarł do Ciebie email aktywacyjny?

Zaloguj się podając nazwę użytkownika, hasło i długość sesji
Aktualności: Forum zostało uruchomione!
 
   Strona główna   Pomoc Zaloguj się Rejestracja  
Strony: [1]
  Drukuj  
Autor Wątek: Powtorzenie - na życzenie,  (Przeczytany 3143 razy)
admin
Administrator
Ekspert
*****
Wiadomości: 821


Email
« : Maj 16, 2011, 09:31:24 »

Zadanie 1 . Napisać program który sprawdzi poprawność wprowadzonego z klawiatury numeru PESEL.

program pesel;
uses crt,dos;
var pes: string;
i:integer;
begin textcolor(white);clrscr;
gotoxy(10,10); write('PODAJ PESEL:');readln(pes);
i:=length(pes);
if i<>11 then
begin clrscr;gotoxy(10,10); textcolor(red); write('BLAD !!!!');
end;

readkey;

end.
Zapisane
admin
Administrator
Ekspert
*****
Wiadomości: 821


Email
« Odpowiedz #1 : Maj 16, 2011, 10:34:30 »

program pesel;
uses crt,dos;
var pes: string;
i,z:integer;
begin textcolor(white);clrscr;
gotoxy(10,10); write('PODAJ PESEL:');readln(pes);
i:=length(pes);
 for z:=1 to i do begin
 if (ord(pes[z])>=48) and (ord(pes[z])<58) then begin end
 else begin write('X');end;

   end;

if i<>11 then
begin clrscr;gotoxy(10,10); textcolor(red); write('BLAD !!!!');
end;

readkey;

end.
« Ostatnia zmiana: Maj 16, 2011, 10:55:06 wysłane przez admin » Zapisane
admin
Administrator
Ekspert
*****
Wiadomości: 821


Email
« Odpowiedz #2 : Maj 16, 2011, 11:38:42 »

program pesel;
uses crt,dos;
var pes: string;
i,x:integer;
begin textcolor(white);clrscr;
gotoxy(10,10); write('PODAJ PESEL:');readln(pes);
i:=length(pes);
for x:=1 to i do
begin

end;

if ((pes[3]='1') and ((pes[4]='0') or (pes[4]='1') or (pes[4]='2'))) then


begin end else

if (pes[3]='0') and  ((ord(pes[4])>=49) and  (ord(pes[4])<58)) then

begin end else
begin writeln('Blad miesiaca'); end;






if i<>11 then
begin clrscr;gotoxy(10,10); textcolor(red); write('BLAD !!!!');
end;

readkey;

end.
Zapisane
admin
Administrator
Ekspert
*****
Wiadomości: 821


Email
« Odpowiedz #3 : Maj 23, 2011, 07:05:19 »

Zadanie 5. Program klasowkowy

program bimbacz;
uses crt,dos;
type
motocykl = record
marka :string[10];
symbol :string[10];
predkoscmax :integer;
end;
var
garaz :array[1..4] of motocykl;
a :integer;
begin
writeln('Jakie 4  motocykle kupujesz?

');
for a:=1 to 4 do
begin
writeln('Marka motocykla nr: ',a,' to: ');
readln(garaz[a].marka);
writeln('Symbol motocykla nr: ',a,' to: ');
readln(garaz[a].symbol);
writeln('Najszybciej jechales motocyklem nr:

',a,'[km/h] ? ');
readln(garaz[a].predkoscmax);
end;
writeln('Wyswietle co jest w garazu wcisnij

ENTER');
readln;
for a:=1 to 4 do
begin
writeln('motorek nr: ',a);
writeln(garaz[a].marka);
writeln(garaz[a].symbol);
writeln(garaz[a].predkoscmax);
end;

write('ktory motor chcesz wyswietlic: ');
readln(a);
writeln('motorek nr: ',a);
writeln(garaz[a].marka);
writeln(garaz[a].symbol);
writeln(garaz[a].predkoscmax);   
writeln('KONIEC wcisnij ENTER');
readkey;
end.
Zapisane
Strony: [1]
  Drukuj  
 
Skocz do:  

Powered by SMF 1.1.11 | SMF © 2006-2008, Simple Machines LLC | Sitemap

Polityka cookies
Darmowe Fora | Darmowe Forum

noname basicrpg justplay watahacemnejstrony elitserienspeedway