Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int mas_size = 0;
- long long mas_max(long long mas[])
- {
- long long max, i = 0;
- max = mas[0];
- while (i < mas_size)
- {
- if (max < mas[i])
- {
- max = mas[i];
- }
- i++;
- }
- return max;
- }
- int main()
- {
- long long mas[10000];
- setlocale(LC_ALL, "russian");
- system("color 0A");
- cout << "Введите массив (0 -- остановиться): " << endl;
- do
- {
- cin >> mas[mas_size];
- mas_size++;
- } while (mas_size < 10000 ^ mas[mas_size - 1] == 0);
- cout << "Максимальное число в массиве = " << mas_max(mas) << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment