poj3364

1a,打个表找找规律就ok了

惹不住晒一下:

#include <iostream> using namespace std; int main() { int n,a,b,c,d; while (cin >> a >> b >> c) { if (a==0 && b==0 && c==0) break; if (a<b) swap(a,b); d=(a-7)/2+(a-7)%2; if (a%2==0) d=d+(b-8)/2*(2*d-1)+(b-8)%2*(d-1); else d=d+(b-8)*d; if (c==0 && a%2==0 && b%2==0) d--; cout << d << endl; } system("pause"); return 0; }

你可能感兴趣的:(c,System)