#include <iostream>
#include <vector>
using namespace std;
int main()
{
int t, n, min;
cin >> t >> n;
int a[n];
for (int i = 0; i < n; ++i){
int mark;
cin >> mark;
a[i] = mark;
}
for (int i = -t; i <= t; ++i){
cout << i << ": ";
for (int j = 0; j < n; ++j)
if(a[j] == i)cout << j + 1 << " ";
cout << endl;
return 0;
Объяснение:
Полностью будет так
M:=X[1];
for k:=2 to N do
if x[k] < M then M := X[k];
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int t, n, min;
cin >> t >> n;
int a[n];
for (int i = 0; i < n; ++i){
int mark;
cin >> mark;
a[i] = mark;
}
for (int i = -t; i <= t; ++i){
cout << i << ": ";
for (int j = 0; j < n; ++j)
if(a[j] == i)cout << j + 1 << " ";
cout << endl;
}
return 0;
}
Объяснение: