arrow_forward همه ارسال‌ها

جزئیات ارسال کد#431

verified
وضعیت داوری نهایی: پذیرفته شد
terminal
زبان برنامه‌نویسی: C++
schedule
ارسال‌کننده و زمان:
Armin Fattahpuor (۲ سال پیش)
descriptionsolution.cpp ۳۱ خط • ۳۵۶ بایت
1#include <iostream>
2
3using namespace std;
4
5int main()
6{
7 int n;
8 cin >> n;
9 int arr[n];
10 for (int i = 0; i < n; ++i)
11 {
12 cin >> arr[i];
13 }
14
15 int index = 0;
16
17 int min = arr[index];
18
19 for (int j ; j < n; ++j)
20 {
21 if (min > arr[j])
22 {
23 min = arr[j];
24 index = j;
25 }
26 }
27
28 cout << index;
29
30 return 0;
31}
کد ارسال‌شده برای داوری خودکار هاتکدز UTF-8