Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <cstdlib>
- #include <time.h>
- using namespace std;
- int zad4(int *T,int n)
- {
- int maxi=*T;
- for(int i=0;i<n;i++)
- {
- if(T[i]>maxi)
- maxi=T[i];
- }
- return maxi;
- }
- int main()
- {
- int n;
- cin>>n;
- int *T4=new int[n];
- srand(time(NULL));
- for(int i=0;i<n;i++)
- {
- T4[i]=rand()%100+1;
- }
- cout<<zad4(T4,n);
- delete [] T4;
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement