Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
343 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
   int mas[100], a,b;
   for (int i = 0; i < 100; i++) {
	   cin >> mas[i];
	   if (mas[i] == 0) {
		   break;
	   }
   }

	   cin >> a >> b;
	   int max = 0;
	   for (int i = a-1; i < b; i++) {
		   if (mas[i] > max) {
			   max = mas[i];
			}
	   }
	   cout << max;
}
Leave a Comment