50A - Domino piling

#include 
using namespace std;

int main()
{
    int m, n;
    cin >> m >> n;
    if (n % 2 == 0 && m % 2 == 0)
    {
        cout << n * m / 2 << endl;
    }
    else
    {
        cout << ((n - 1) / 2 * m + (m - 1) / 2) << endl;
    }

    system("pause");
}

你可能感兴趣的:(50A - Domino piling)