讨论 / 谁帮我看看错呀(客栈问题)
john庹 2013-08-22 21:47:00
点我顶贴 收藏 删除
#include<iostream>

using namespace std;

int main()

{

int a=0,b=0,d=0,e=0,p=0,sum=0;

cin>>a>>b>>p;

int x[a][2];

for(d=0;d<a;d++)

{

cin>>x[d][0]>>x[d][1];

}

for(d=0;d<a;d++)

{

for(e=d+1;e<a;e++)

{

if(x[d][0]==x[e][0])

{

if((x[d][1]<=p)||(x[e][1]<=p))

{

sum=sum+1;

}

}

}

}

cout<<sum;

return 0;

}

查看更多回复
提交回复