Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
284 B
0
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
	int num, maxNum = 0, numMaxNum = 0;

	for (int i = 1; true; i++)
	{
		cin >> num;
		if (num < 0) break;
		if (num > maxNum)
		{
			maxNum = num;
			numMaxNum = i;

		}
	}
	cout << maxNum << ' ' << numMaxNum;
}