Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int n;
- cout << "Enter the number of array: ";
- cin >> n;
- int* array = new int [n];
- int max;
- cout << "Enter the numbers:\n";
- for (int i = 0; i < n; i ++) {
- cin >> array[i];
- if (i == 0) {
- max = array[i];
- }
- else if (max < array[i]) {
- max = array[i];
- }
- }
- cout << "\nYour array: ";
- for (int i = 0; i < n; i++) {
- cout << array[i] << " ";
- }
- cout << "\nMax number of array: " << max;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement