5分钟完成
#include<iostream>
using namespace std;
const int N=10;
int X[N];
int main()
{
//freopen("xxx.in","r",stdin);
//freopen("yyy.out","w",stdout);
for(int i=0;i<N;i++)
{
cin >> X[i];
if(X[i]==0 || X[i]<0)
X[i]=1;
}
for(int i=0;i<N;i++)
{
cout << "X[" << i << ']' << " = " << X[i] << endl;
}
//fclose(stdin);
//fclose(stdout);
return 0;
}