我有 我使用C++运输及工务局局长不是一个函数
而且这里有一个问题是我的代码:
#include<iostream>
using namespace std;
void balloon(){ //start void
int num, N[10], x, y, z,temp,setw;
cout<<"How many number would you like to sort? ";
cin>>num;
cout<<"Input the "<<num<<" numbers:"<<endl;
for(x=0;x<num;x++)
cin>>N[x];
for(x=0;x<num;x++)
{
for(y=0;y<num-x;y++)
{
if(N[x] > N[x+y])
{
temp=N[x];
N[x] =N[x+y];
N[x+y]=temp;
}
}
cout<<"pass "<<x+1<<"] ";
for(z=0;z<num;z++)
{
cout<<setw(5)<<N[z];
}
cout<<endl;
}
}//end void
我得到一个错误运输及工务局局长不是一个函数 请帮我,如果您发现了一些更多的错误,请通知我 谢谢
您[缺少标题](http://www.cplusplus.com/reference/iomanip/setw/)。 –
您也在第5行中声明了'setw'作为int变量。 –
请阅读您使用的语言功能的文档。不要随意猜测。 –