Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
实在是看不处问题在哪里了啊!哪位做出来了的高手能否指点哈!#include <iostream> using namespace std; int main() { int p,t,m,n,difp,a[103][103]={}; //用一个二维数组标示,元素值标示第p个人推测第t棵树倒了 cin>>p>>t; difp=p; while(cin>>m>>n){ a[m-1][n-1]=1; } for(int i=0;i<p;i++) for(int j=i+1,k;j<p;j++) { for(k=0;k<t;k++) { if(a[i][k]!=a[j][k]) break; else continue; } if(k==t) {i++;difp--;} } cout<<difp<<endl; system("pause"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator