poj 3364 Black and white painting

#include 
using namespace std;

int main()
{
    int n, m, c, ans;
    while (cin >> n >> m >> c){
          if (n == 0 && m == 0 && c == 0)  break;
          if (c == 1 && (n-7) % 2 == 1 && (m-7) % 2 == 1)
              ans = ((n-7)*(m-7)+1)/2;
          else 
              ans = ((n-7)*(m-7))/2;
          cout << ans << endl;
    }
    system("pause");
}

你可能感兴趣的:(POJ)