Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. KODOVANIE
  2. program Project1;
  3. var znak:char;
  4. i, znakcis: integer;
  5. subor: text;
  6. pis, vys, kon: string;
  7.  
  8. begin
  9. randomize;
  10. znakcis:=random (97)+33;
  11. znak:=chr(znakcis);
  12. writeln(znakcis);
  13. assign (subor,'C:\Users\PC\Desktop\subor.txt');
  14. reset (subor);
  15. while not EOF(subor) do readln(subor,pis);
  16. close (subor);
  17. for i:=1 to length(pis) do begin
  18. vys:=vys+(pis[i]+znak)
  19. end;
  20. writeln (vys);
  21. readln;
  22. for i:=1 to length(vys) do begin
  23. if (i mod 2=0) then delete(vys[i],1,1)
  24. else kon:=kon+vys[i];
  25. end;
  26. writeln (kon);
  27. readln;
  28. end.
  29.  
  30.  
  31.  
  32. VYSVEDCENIE
  33. program Project1;
  34. var p:array[1..10] of integer;
  35. x, i, n:integer;
  36. ap:real;
  37.  
  38. begin
  39. writeln ('Zadaj svoje znamky.');
  40. x:=0;
  41. n:=0;
  42. for i:=1 to 10 do begin
  43. readln(p[i]);
  44. x:=x+p[i];
  45. if n<p[i] then n:=p[i];
  46. end;
  47. ap:=x/10;
  48. if (ap<=1.5) then if (n<3) then begin writeln ('Prospel si s vyznamenanim.');
  49. if n<3 then break;
  50. end;
  51. if (ap<=2) then if (n<4) then writeln ('Prospel si velmi dobre.');
  52. if (ap<=4) then if (n<5) then writeln ('Prospel si.');
  53. if (n=5) then writeln ('Neprospel si.');
  54. readln;
  55. end.
  56.  
  57.  
  58. PRVOCISLO
  59. program Project1;
  60. var x, i, a, b, c:integer;
  61.  
  62. begin
  63. writeln ('Zadaj interval.');
  64. readln(a,b);
  65. write ('Toto su prvocisla: ');
  66. for i:=a to b do begin
  67. for c:=2 to i do begin
  68. x:=i mod c;
  69. if x=0 then break;
  70. end;
  71. if c=i then write(c,', ');
  72. end;
  73. readln;
  74. end.
  75.  
  76.  
  77. STASTNE CISLO
  78. program stasnecis2;
  79. var i,s1,s2,porad:integer;
  80. pole:array[1..6] of integer;
  81.  
  82. begin
  83. porad:=0;
  84. randomize;
  85. repeat
  86. write ('Nahodne cislo je ');
  87. for i:=1 to 6 do begin
  88. pole[i]:=random(10);
  89. write (pole[i]);
  90. end;
  91. writeln;
  92. s1:=pole[1]+pole[2]+pole[3];
  93. s2:=pole[4]+pole[5]+pole[6];
  94. if s1=s2 then begin Writeln('Cislo je stastne cislo.');
  95. porad:=4;
  96. end
  97. else begin writeln('Cislo nie je stastne cislo.');
  98. inc(porad);
  99. end;
  100. until porad>=3;
  101. readln;
  102. end.
  103.  
  104.  
  105.  
  106. TROJUHEL
  107. program trojuholnik;
  108. var a, b, c, x, y: integer;
  109.  
  110. begin
  111. writeln ('zadaj strany a, b, c');
  112. readln (a);
  113. readln (b);
  114. readln (c);
  115. if (a+b>c) and (b+c>a) and (a+c>b) then begin
  116. y:=(a*a)+(b*b);
  117. x:=c*c;
  118. if x=y then writeln ('je pravouhly')
  119. else writeln ('nie je pravouhly');
  120. end
  121. else writeln ('neda sa zostrojit');
  122. readln;
  123. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement