There are two rectangles. The lengths of the vertical sides of the first rectangle are A, and the lengths of the horizontal sides of the first rectangle are B. The lengths of the vertical sides of the second rectangle are C, and the lengths of the horizontal sides of the second rectangle are D.
Print the area of the rectangle with the larger area. If the two rectangles have equal areas, print that area.
Constraints- All input values are integers.
- 1≤A≤104
- 1≤B≤104
- 1≤C≤104
- 1≤D≤104
The input is given from Standard Input in the following format:
A B C DOutput
Print the area of the rectangle with the larger area. If the two rectangles have equal areas, print that area.
Sample Input 13 5 2 7Sample Output 1
15
The first rectangle has an area of 3×5=15, and the second rectangle has an area of 2×7=14. Thus, the output should be 15, the larger area.
Sample Input 2100 600 200 300Sample Output 2
60000
AC代码:
Select Code
#include<stdio.h>
int main()
{
int a,b,c,d,s1,s2;
scanf("%d%d%d%d",&a,&b,&c,&d);
s1=a*b;
s2=c*d;
if(s1>=s2)
printf("%d\n",s1);
else
printf("%d\n",s2);
}