|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 小水 于 2014-4-29 20:58 编辑
编译出现错误,求大神讲解error: functional cast expression list treated as compound expression
函数实现功能:输入员工的姓名,出生日期(月/日),按日期大小输出员工姓名
代码:
#include<iostream>
using namespace std;
struct Employ{
string a;
int mouth;
int day;
};
void sort(Employ e[],int n)
{
Employ temp;
for(int i=0;i<n;i++)
{ temp.a=e[i].a;
temp.mouth=e[i].mouth;
temp.day=e[i].day;
for(int j=i+1;j<0;j++)
{
if(temp.mouth>e[j].mouth)
{temp.mouth=e[j].mouth;
temp.day=e[j].day;
temp.a=e[j].a;
}
if(temp.mouth==e[j].mouth){
if(temp.day>e[j].day)
{
temp.a=e[j].a;
temp.day=e[j].day;
}
}
}
cout<<temp.a<<temp.mouth<<temp.day<<endl;
}
}
int main()
{
int num;
cout<<"please intput the number of employ"<<endl;
cin>>num;
Employ e_num[num];
for(int i=0;i<num;i++)
{
cout<<"please input the name of "<<i+1<<" employ "<<endl;
cin>>e_num[i].a;
cout<<"please input the mouth of "<<i+1<<" employ (1-12)"<<endl;
cin>>e_num[i].mouth;
cout<<"please input the day of "<<i+1<<" employ (1-31)"<<endl;
cin>>e_num.day;
cout<<endl;
}
void(e_num,num);
return 0;
}
[/i][/i][/i][/i][/i] |
|