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

Re:帮忙看看吧!我都不知道那里错了哦!刚才按错了,这个才是!!谢谢了!!!

Posted by 90401307 at 2005-01-07 14:16:20 on Problem 1552
In Reply To:帮忙看看吧!我都不知道那里错了哦 Posted by:90401307 at 2005-01-07 14:15:23
#include<stdio.h>
void main(){
	int num[16],i,j,dl=0,m;
	scanf("%d",&num[1]);
	while(num[1]!=-1){
		for(i=2;i<=15;i++){
			if(num[i-1]!=0){
				scanf("%d",&num[i]);
			}
			else if(num[i-1]==0)
				break;
		}
		m=i-1;
		for(i=1;i<m;i++){
			for(j=1;j<m;j++){
				if(num[i]==2*num[j])
					dl++;
			}
		}
		printf("%d\n",dl);
		dl=0;
		scanf("%d",&num[1]);
	}
}

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