输出不是预期的

output is not what expected

#include<iostream>  
#include<conio.h>
#include<string.h>
#include<ctype.h>
#include<stdio.h>


using namespace std;



int swapper(int n[],int s
)
{
for(int i=0;i<s;i++)
{
    int temp=n[i];
    n[i]=n[i+1];
    n[i+1]=temp;
}
cout<<"\n Array Swapped !!!";
for (int i=0;1<s;i++)
{

    cout<<n[i]<<"\t";
}
return 0;
  }


int main()

 { 
 int n[20]; int s;

cout<<"\n enter array size:";

cin>>s;
cout<<"enter no in array according to size given";

for(int j=0;j<s;j++)

    {

        cin>>n[j];

    }

 swapper(n,s);

 return 0;

 getch();

 }

此程序的输出不交换数组元素,
相反,它开始大量生产数字
整个代码写在这里
所有其他建议的更改都已完成

该函数应该接受一个整数数组及其大小作为参数,并显示一个交换相邻元素的数组。

来电

swapper(n[],s);

不对。假设 swapper 的第一个参数是 int*,它需要是:

swapper(n,s);

删除交换函数中的 []