Răspuns:
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("numere.in");
ofstream g("numere.out");
int n,x,i,jum,j;
int main()
{
f >> n;
for (i=1; i<=n; i++)
{
f >> x;
jum=x/2;
for (j=x-jum; j<=x+jum; j++)
{
g << j << " ";
}
g << endl;
}
return 0;
}
Explicație: