#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
long m,n,c;
while(scanf("%lld%lld",&m,&n)!=EOF){
c=m*(m+1)/2*n*(n+1)/2;
printf("%lld\n",c);
}
return 0;
#include <stdlib.h>
int main(int argc, char *argv[]) {
long m,n,c;
while(scanf("%lld%lld",&m,&n)!=EOF){
c=m*(m+1)/2*n*(n+1)/2;
printf("%lld\n",c);
}
return 0;
}
矩阵问题,实际上就是将问题转化为数学模型,寻其规律便是矩阵x,y的累加和乘积。
x轴不难发现是累加,重点是y轴的规律需要灵活思考。