7.6

#include<iostream>

using std::cin;
using std::cout;
using std::endl;
void Fill_array(double ar[],int number)
{
	int i =0;
	while(i<number&&cin>>ar[i])
	
		i++;
}
void Show_array(double ar[], int number)
{
	int len= sizeof(ar);
	for(int i =0;i<len;i++)
		cout<<ar[i]<<" ";
}
void Reverse_array(double ar[],int number)
{
	int len = sizeof(ar);
	int temp;
	for(int i=0,j=len-1;i<len/2;i++,j--)
	{
		temp=ar[i];
		ar[i]=ar[j];
		ar[j]=temp;
	}
}
void Ra(double ar[], int number)
{
	int len = sizeof(ar);
	int temp;
	for(int i=1,j=len-2;i<len/2;i++,j--)
	{
		temp=ar[i];
		ar[i]=ar[j];
		ar[j]=temp;
	}
}
int main()
{
	double str[6];
	Fill_array( str,6);
	/*Show_array(str,6);
	cout<<endl;
	Reverse_array(str,6);
   Show_array(str,6);
   cout<<endl;*/
   Ra(str,6);
   Show_array(str,6);
	system("pause");
	return 0;
}

阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭