countRectangles

来源:互联网 发布:linux 切换root用户 编辑:程序博客网 时间:2024/06/04 23:34
#include<iostream>
using namespace std;
long long countRectangles(int width,int height)
{
long long count=0;
for(int i=width;i>0;--i)
{
for(int j=1;j<=height;++j)
{
if(i!=j)
count+=(width+1-i)*(height+1-j);
}
}
return count;
}
int main()
{
cout<<countRectangles(592,964)<<endl;
return 0;
}
0 0
原创粉丝点击