|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include<iostream>
using namespace std;
template<typename T>;
void rant(T p[],T s)
{
int temp;
for(int i=0;i<s-1;i++)
for(int j=i+1;j<s;j++)
{
if(p[i]>p[j])
{
temp=p[i];
p[i]=p[j];
p[j]=temp;
}
}
for(int f=0;f<s;f++)
cout<<p[f]<<endl;
}
int main()
{
int a[100];
float b[100];
double c[100];
int n;
cout<<"please input the amount of numbers:"<<endl;
cin>>n;
for(int i=0;i<n;i++)
cin<<a[i];
rant(a,n);
for(int j=0;j<n;j++)
cin<<b[j];
rant(b,n);
for(int k=0;k<n;k++)
cin<<c[k];
rant(c,n);
return 0;
}
例题.cpp
e:\作业\练习\引用\例题.cpp(4) : error C2059: syntax error : '<end Parse>'
e:\作业\练习\引用\例题.cpp(6) : error C2143: syntax error : missing ';' before '{'
e:\作业\练习\引用\例题.cpp(6) : error C2447: missing function header (old-style formal list?)
e:\作业\练习\引用\例题.cpp(34) : fatal error C1903: unable to recover from previous error(s); stopping compilation
问题:不明白是怎么回事?提示也不知道在说什么! |
|