level 2
#include<iostream>
int main()
{
int a[5],i,temp;
cout<<"input a:";
for (i=0;i<5;i++)
{
cin>>a[i];
}
cout<<"array a:";
for (i=0;i<5;i++)
cout<<a[i]<<" ";
cout<<endl;
for (i=0;i<2;i++)
{
temp=a[i];
a[i]=a[4-i];
a[4-i]=temp;
}
cout<<"now array a:";
for (i=0;i<5;i++)
cout<<a[i]<<endl;
}
2015年02月04日 11点02分
1
level 8
编译不通过的话,下面应该会写什么错误,然后你把那些错误复制一下,百度,就有答案了
随便一提,你没有指定命名空间
using namespace std;
2015年02月04日 12点02分
2