?? ch10_9.cpp
字號:
//**********************
//** ch10_9.cpp **
//**********************
#include <iostream.h>
struct Person
{
char name[20];
unsigned long id;
float salary;
};
Person GetPerson()
{
Person temp;
cout <<"Please enter a name for one person:\n";
cin>>temp.name;
cout <<"Please enter one's id number and his salary:\n";
cin >>temp.id >>temp.salary;
return temp;
}
void Print(Person& p)
{
cout <<p.name <<" "
<<p.id <<" "
<<p.salary <<endl;
}
void main()
{
Person employee[3];
for(int i=0; i<3; i++){
employee[i]=GetPerson();
Print(employee[i]);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -