poj 3364 Black and white painting

来源:互联网 发布:视频网站程序 linux 编辑:程序博客网 时间:2024/05/16 04:59
#include <iostream>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");}