mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1037.cpp
This commit is contained in:
parent
fa4458d94d
commit
3cdd8f5d94
27
ZOJ/1037.cpp
Normal file
27
ZOJ/1037.cpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cmath>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int t;
|
||||||
|
int a,b;
|
||||||
|
scanf("%d",&t);
|
||||||
|
for(int i=0;i<t;i++)
|
||||||
|
{
|
||||||
|
scanf("%d %d",&a,&b);
|
||||||
|
printf("Scenario #%d:\n",i+1);
|
||||||
|
if(a%2==0||b%2==0)
|
||||||
|
{
|
||||||
|
printf("%.2f\n",(double)a*b);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("%.2f\n",(double)a*b-1+sqrt(2));
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user