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 KatrineYang at 2016-11-06 13:30:19 on Problem 2707
#include <stdio.h>
void j(int &A,int &B){
	int t=A;A=B;B=t;
}
int m(int a,int b){
	return a>b?b:a;
}
int main() {
	int A,B,C,D;
	char b='%';
	while(1){
		scanf("%d%d%d%d",&A,&B,&C,&D);
		if(!A)break;
		if((B-A)>>31)j(A,B);
		if((D-C)>>31)j(C,D);
		int p=m(100*C/A,100*D/B),r=((p-100)>>31)?p:100;
		printf("%d%c\n",r,b);
	}
	return 0;
}

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