Advertisement
CzarnyBarszcz

Untitled

Mar 22nd, 2020
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <cstdlib>
  4. #include <time.h>
  5.  
  6. using namespace std;
  7.  
  8. int zad4(int *T,int n)
  9. {
  10. int maxi=*T;
  11. for(int i=0;i<n;i++)
  12. {
  13. if(T[i]>maxi)
  14. maxi=T[i];
  15. }
  16. return maxi;
  17. }
  18.  
  19. int main()
  20. {
  21. int n;
  22. cin>>n;
  23. int *T4=new int[n];
  24. srand(time(NULL));
  25.  
  26. for(int i=0;i<n;i++)
  27. {
  28. T4[i]=rand()%100+1;
  29. }
  30.  
  31. cout<<zad4(T4,n);
  32.  
  33. delete [] T4;
  34. getch();
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement