65,210
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
#include<string>
using namespace std;
struct a
{
string l;
int m;
int n;
};
int count1[360],lpo=0;
int main()
{
int co=0;
int count,m1[180],n1[180];
string l1[180];
a b[180];
int count2=1;
cin>>count;
for(int o=0;o<count;o++)
{
cin>>b[o].l>>b[o].m>>b[o].n;
}
cout<<endl;
for(int q=0;q<count;q++)
{
if(b[q].m==b[count2].m&&b[q].n==b[count2].n)
{
count1[co]=q;
count1[co+1]=count2;
co+=2;
lpo++;
}
count2++;
int ui=0;
if(q==count)
{
for(int u=1;u<count;u++)
{
q=u;
ui++;
if(ui==count)
break;
break;
}
}
if(lpo==0)
cout<<"None"<<endl;
}
for(int i=0;i<co;i++)
{
int oplk=0;
if(oplk==0)
{
cout<<b[count1[i]].m<<' '<<b[count1[i]].n<<b[count[i]].l<<' '; //这里的count 是int 类型,你携程数组了,不太解你想写什么。
}
else
{
cout<<b[count[i]].l;
}
}
return 0;
}