简单题
View Code
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
int n, m, c;
int main()
{
//freopen("t.txt", "r", stdin);
while (scanf("%d%d%d", &n, &m, &c), n | m | c)
{
if ((n + m) & 1)
c = 1 - c;
n = n - 8 + 1;
m = m - 8 + 1;
int ans = n * m / 2;
if (c)
ans = n * m - ans;
printf("%d\n", ans);
}
return 0;
}
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
int n, m, c;
int main()
{
//freopen("t.txt", "r", stdin);
while (scanf("%d%d%d", &n, &m, &c), n | m | c)
{
if ((n + m) & 1)
c = 1 - c;
n = n - 8 + 1;
m = m - 8 + 1;
int ans = n * m / 2;
if (c)
ans = n * m - ans;
printf("%d\n", ans);
}
return 0;
}