4.C

题目连接:http://acm.hust.edu.cn/vjudge/contest/125308#problem/C

题目要求计算 n*m的网格中矩形的个数。行和列是相当的,每一行有m!个矩形,每一列有n!个矩阵,所以一共有n!*m!个矩阵

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int t;
    int a,b,sum;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d %d",&a,&b);
        sum=a*(a+1)/2*b*(b+1)/2;
        printf("%d
",sum);

    }
}
原文地址:https://www.cnblogs.com/Twsc/p/5725294.html