Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- KODOVANIE
- program Project1;
- var znak:char;
- i, znakcis: integer;
- subor: text;
- pis, vys, kon: string;
- begin
- randomize;
- znakcis:=random (97)+33;
- znak:=chr(znakcis);
- writeln(znakcis);
- assign (subor,'C:\Users\PC\Desktop\subor.txt');
- reset (subor);
- while not EOF(subor) do readln(subor,pis);
- close (subor);
- for i:=1 to length(pis) do begin
- vys:=vys+(pis[i]+znak)
- end;
- writeln (vys);
- readln;
- for i:=1 to length(vys) do begin
- if (i mod 2=0) then delete(vys[i],1,1)
- else kon:=kon+vys[i];
- end;
- writeln (kon);
- readln;
- end.
- VYSVEDCENIE
- program Project1;
- var p:array[1..10] of integer;
- x, i, n:integer;
- ap:real;
- begin
- writeln ('Zadaj svoje znamky.');
- x:=0;
- n:=0;
- for i:=1 to 10 do begin
- readln(p[i]);
- x:=x+p[i];
- if n<p[i] then n:=p[i];
- end;
- ap:=x/10;
- if (ap<=1.5) then if (n<3) then begin writeln ('Prospel si s vyznamenanim.');
- if n<3 then break;
- end;
- if (ap<=2) then if (n<4) then writeln ('Prospel si velmi dobre.');
- if (ap<=4) then if (n<5) then writeln ('Prospel si.');
- if (n=5) then writeln ('Neprospel si.');
- readln;
- end.
- PRVOCISLO
- program Project1;
- var x, i, a, b, c:integer;
- begin
- writeln ('Zadaj interval.');
- readln(a,b);
- write ('Toto su prvocisla: ');
- for i:=a to b do begin
- for c:=2 to i do begin
- x:=i mod c;
- if x=0 then break;
- end;
- if c=i then write(c,', ');
- end;
- readln;
- end.
- STASTNE CISLO
- program stasnecis2;
- var i,s1,s2,porad:integer;
- pole:array[1..6] of integer;
- begin
- porad:=0;
- randomize;
- repeat
- write ('Nahodne cislo je ');
- for i:=1 to 6 do begin
- pole[i]:=random(10);
- write (pole[i]);
- end;
- writeln;
- s1:=pole[1]+pole[2]+pole[3];
- s2:=pole[4]+pole[5]+pole[6];
- if s1=s2 then begin Writeln('Cislo je stastne cislo.');
- porad:=4;
- end
- else begin writeln('Cislo nie je stastne cislo.');
- inc(porad);
- end;
- until porad>=3;
- readln;
- end.
- TROJUHEL
- program trojuholnik;
- var a, b, c, x, y: integer;
- begin
- writeln ('zadaj strany a, b, c');
- readln (a);
- readln (b);
- readln (c);
- if (a+b>c) and (b+c>a) and (a+c>b) then begin
- y:=(a*a)+(b*b);
- x:=c*c;
- if x=y then writeln ('je pravouhly')
- else writeln ('nie je pravouhly');
- end
- else writeln ('neda sa zostrojit');
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement