#include<bits/stdc++.h>
using namespace std;
int main()
{
int arr[14], mn = 1e9, ind;
for(int i = 0; i < 14; i++)
cin >> arr[i];
if(arr[i] < mn)
mn = arr[i];
ind = i;
}
for(int i = ind + 1; i < 14; i++)
if(arr[i] > 0)
cout << i + 1;
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
int arr[14], mn = 1e9, ind;
for(int i = 0; i < 14; i++)
{
cin >> arr[i];
if(arr[i] < mn)
{
mn = arr[i];
ind = i;
}
}
for(int i = ind + 1; i < 14; i++)
if(arr[i] > 0)
{
cout << i + 1;
return 0;
}
}