Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/145.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ C++;带结构的数组字符 struct-prof { 字符串fn; 字符串ln; 串度; 字符串dep; 字符串位置; }; int main() { ins教授[50]; int i=0; int h=0; int d=0; 智力选择; a: 根据我的理解,您希望对某种结构类型的数组进行排序_C++ - Fatal编程技术网

C++ C++;带结构的数组字符 struct-prof { 字符串fn; 字符串ln; 串度; 字符串dep; 字符串位置; }; int main() { ins教授[50]; int i=0; int h=0; int d=0; 智力选择; a: 根据我的理解,您希望对某种结构类型的数组进行排序

C++ C++;带结构的数组字符 struct-prof { 字符串fn; 字符串ln; 串度; 字符串dep; 字符串位置; }; int main() { ins教授[50]; int i=0; int h=0; int d=0; 智力选择; a: 根据我的理解,您希望对某种结构类型的数组进行排序,c++,C++,我会使用中的stable\u sort传递lambda对部门进行排序。首先,让我问一下“数组字符”是什么:我是新来的,抱歉我的错误,我猜我想说的是数组元素 struct prof { string fn; string ln; string deg; string dep; string pos; }; int main () { prof ins[50]; int i=0; int h=0; int d=0; int choice;

我会使用
中的
stable\u sort
传递
lambda
对部门进行排序。

首先,让我问一下“数组字符”是什么:我是新来的,抱歉我的错误,我猜我想说的是数组元素
 struct prof
 {
string fn;
string ln;
string deg;
string dep;
string pos;
   };


   int main ()
   {
    prof ins[50];
   int i=0;
   int h=0;
   int d=0; 
   int choice;
   a:
   cout<<"Good Day!!"<<endl;

  cout<<"How many college instructor you want to input?";
   cin>>h;




 for(i=0;i<h;i++)
{


cout<<"First name:";
cin>>ins[i].fn;
cout<<"Last name:";
cin>>ins[i].ln;

cout<<"Department:";
cin>>ins[i].dep;

cout<<"Position:";
cin>>ins[i].pos;
cout<<"Degree:";
cin>>ins[i].deg;

 }


cout << "   "<<endl;
cout << "Here are the "<<h<<" college instructor that you encode:"<<endl;
cout << "   "<<endl;


 for(i=0;i<h;i++)

{


cout<<"# "<<i<<" Name: "<<ins[i].fn<<" "<<ins[i].ln<<endl;
cout<<"# "<<i<<" Department: "<<ins[i].dep<<endl;
cout<<"# "<<i<<" Position: "<<ins[i].pos<<endl;
cout<<"# "<<i<<" Degree: "<<ins[i].deg<<endl;
cout<<"                    "<<endl;

getch ();
}

 cout << " Thank you for using this program, do you want to encode again?   Yes(1)          No(2) "<<endl;
cin >> choice;

if (choice==1) {goto a;}
if (choice==2) {return 0;}


}