Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

是不是我忽略了什么特殊情况啊?希望指教

Posted by konygreen at 2005-09-10 21:18:46 on Problem 1088
#include <iostream.h>
int main()
{
	int n,m,sum;
	int num[1000];
	sum = 1;
	cin >> n >> m;
    for(int i = 0;i < n*m;i++){
		cin>>num[i];
		for(int j = 0;j < i;j++){
			if(num[i] == num[j])break;
			if(j == i-1){
				sum++;
			}
		}
	}
	for(int k = 0;k < n*m;k++){
		if(num[k] == 0)sum--;break;
	}
	cout<<sum<<endl;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator