国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > php开源 > php教程 > 8 UVA 10790 How Many Points of Intersection?

8 UVA 10790 How Many Points of Intersection?

来源:程序员人生   发布时间:2015-05-14 08:56:17 阅读次数:2425次

第1排第i个点和第2排第j个点相连,在这条线段上会产生(a-i)*(j⑴)个交点,

以此类推,推公式便可。


#include<cstdio> #define ll long long ll a,b; int cas=1; int main() { while(~scanf("%d%d",&a,&b)&&(a||b)) printf("Case %d: %lld ",cas++,a*(a⑴)/2*b*(b⑴)/2); return 0; }


生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生