为什么我在devc++里能正常运行的程序代码,放到visualc++里运行不了了?

#include
#include
using namespace std;
class Salesperson
{
private:
int number;
string name;
double esspay;
double bonus;
public:
Salesperson(int n=1,string a="张三",double e=5000,double b=2000);
Salesperson(Salesperson &ss);
Salesperson();
void input();
void Show();
void Total();
};
Salesperson::Salesperson(int n,string a,double e,double b):number(n),name(a),esspay(e),bonus(b)
{
}
Salesperson::Salesperson(Salesperson &ss)
{
this->number=ss.number;
this->name=ss.name;
this->esspay=ss.esspay;
this->bonus=ss.bonus;
}
Salesperson::
Salesperson()
{
}
void Salesperson::input()
{
cout<<"请依次输入售货员编号,售货员姓名,基本工资,奖金:"<<endl;
cin>>number>>name>>esspay>>bonus;
return;
}
void Salesperson::Show()
{
cout<<"售货员编号:"<<number<<"售货员姓名:"<<name<<"基本工资:"<<esspay<<"奖金:"<<bonus<<endl;
}
void Salesperson::Total()
{
cout<<name<<"实发工资为:"<<esspay+bonus<<endl;
}
int main()
{
int i;
Salesperson S1;
S1.Show();
Salesperson S2(S1);
S2.Show();
Salesperson a[2]=
{
};
for(i=0;i<2;i++)
{
a[i].input();
}
for(i=0;i<2;i++)
{
a[i].Total();
}
}

可以运行啊,代码如下:

img

#include <iostream>
#include <string>
using namespace std;
class Salesperson
{
private:
    int number;
    string name;
    double esspay;
    double bonus;
public:
    Salesperson(int n = 1, string a = "张三", double e = 5000, double b = 2000);
    Salesperson(Salesperson& ss);
    ~Salesperson();
    void input();
    void Show();
    void Total();
};
Salesperson::Salesperson(int n, string a, double e, double b) :number(n), name(a), esspay(e), bonus(b)
{
}
Salesperson::Salesperson(Salesperson& ss)
{
    this->number = ss.number;
    this->name = ss.name;
    this->esspay = ss.esspay;
    this->bonus = ss.bonus;
}
Salesperson::~Salesperson()
{
}
void Salesperson::input()
{
    cout << "请依次输入售货员编号,售货员姓名,基本工资,奖金:" << endl;
    cin >> number >> name >> esspay >> bonus;
    return;
}
void Salesperson::Show()
{
    cout << "售货员编号:" << number << "售货员姓名:" << name << "基本工资:" << esspay << "奖金:" << bonus << endl;
}
void Salesperson::Total()
{
    cout << name << "实发工资为:" << esspay + bonus << endl;
}
int main()
{
    int i;
    Salesperson S1;
    S1.Show();
    Salesperson S2(S1);
    S2.Show();
    Salesperson a[2] =
    {
    };
    for (i = 0; i < 2; i++)
    {
        a[i].input();
    }
    for (i = 0; i < 2; i++)
    {
        a[i].Total();
    }
}