| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
1a#include<iostream>
using namespace std;
int main()
{
int a,i=1;
cin >> a;
while (a--){
int c, d;
float sum;
cin >> c >> d;
if (c*d%2 == 0){
sum = float(c*d);
cout << "Scenario #" << i <<":"<< endl;
printf("%.2f\n", sum);
cout << endl;
}
else {
cout << "Scenario #" << i <<":"<< endl;
cout << c*d+0.41<< endl;
cout << endl;
}
i++;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator