zrq495
www.zrq495.com

求n*m的网格中有多少九宫格,公式:(n/3)*(m/3)。

代码:

 1 #include<iostream>
 2 
 3 using namespace std;
 4 
 5 int main()
 6 {
 7     int n, m;
 8     int t;
 9     cin >> t;
10     while(t--)
11     {
12         cin >> n >> m;
13         cout << (n/3)*(m/3) << endl;
14     }
15     return 0;
16 }
posted on 2012-07-27 15:34  zrq495  阅读(168)  评论(0编辑  收藏  举报