SHARE
TWEET

Untitled

a guest Oct 21st, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program p1;
  2.  
  3. var i:integer;
  4.  
  5. type ora=0..23;
  6.     grade=-40..40;
  7.     Temperatura=array [Ora] of Grade;
  8.  
  9. var Temp:Temperatura;
  10.    
  11. procedure MaxT(t: Temperatura);
  12. var i:integer;
  13. var max,min:integer;
  14. begin
  15. max:=t[1];
  16. min:=t[1];
  17. for i:=0 to 23 do if max<t[i] then max:=t[i];
  18. for i:=0 to 23 do if min>t[i] then min:=t[i];
  19. writeln('Minimul temperaturii este ',min);
  20. writeln('Maximul temperaturii este ',max);
  21. end;
  22.  
  23.  
  24. procedure MaxTime(t: Temperatura);
  25. var i:integer;
  26. var maxT:integer;
  27. begin
  28. maxT:=0;
  29. for i:=0 to 23 do if t[maxT]<t[i] then maxT:=i;
  30. writeln('Temperatura maxima s-a inregistrat la ora ',maxT);
  31. end;
  32.  
  33. procedure MinTime(t: Temperatura);
  34. var i:integer;
  35. var minT:integer;
  36. var f:text;
  37. begin
  38. assign(f,'temp.out');
  39. rewrite(f);
  40. minT:=0;
  41. for i:=0 to 23 do if t[minT]>t[i] then minT:=i;
  42. writeln(f, 'Temperatura minima s-a inregistrat la ora ',minT);
  43. close(f);
  44. end;
  45.  
  46.  
  47. begin
  48. for i:=0 to 23 do begin
  49. write('Introduceti Temperatura la ora ',i,':');
  50. readln(Temp[i]);
  51. end;
  52.  
  53. MaxT(Temp);
  54. MaxTime(Temp);
  55. MinTime(Temp);
  56.  
  57. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top