Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- void Func1(int *mas, int max, int n)
- {
- for (int i = 0; i < n; ++i)
- {
- if (mas[i] > max)
- {
- max=mas[i];
- }
- }
- for (int i = 0; i < n; ++i)
- {
- cout << max << "\t"; break;
- }
- }
- int main()
- {
- int n, max=0;
- cin >> n;
- int *mas = new int[n];
- for (int i = 0; i < n; ++i)
- {
- cout << "mas[" << i << "]=";
- cin >> mas[i];
- }
- Func1(mas, max, n);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement