Guest User

Untitled

a guest
Jun 12th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.74 KB | None | 0 0
  1. var a, b, c:array [1..100] of real;
  2.     i, j, n:integer;
  3.  
  4. begin
  5.    repeat
  6.      readln(n);
  7.    until (n < 101) and (n > 0);
  8.  
  9.    for i := 1 to n do
  10.       begin
  11.         readln(a[i], b[i]);
  12.         //a) c[i] = min {a[i], b[i]} | c[i] postaje manji
  13.         if a[i] > b[i] then c[i] := b[i]
  14.              else c[i] := a[i];
  15.  
  16.         //b) c[i] = max{a[i], b[i]} | c[i] postaje ve†i
  17.         if a[i] > b[i] then c[i] := a[i]
  18.              else c[i] := b[i];
  19.  
  20.         //c) c[i] = {13 ako je a[i] = b[i], inaźe a[i]*b[i]}
  21.         if a[i] = b[i] then c[i] := 13   //13
  22.              else c[i] := a[i] * b[i];  //inaźe pomno§imo
  23.  
  24.       end;
  25.  
  26.    //ispis
  27.  
  28.    //for i := 1 to n do writeln(a[i]:10:2, b[i]:10:2, c[i]:10:2);
  29.  
  30.    readln;
  31. end.
Add Comment
Please, Sign In to add comment