UVA 10790-How Many Points of Intersection?#
来源:互联网 发布:数据中心网络拓扑图 编辑:程序博客网 时间:2024/05/18 21:07
UVA 10790-How Many Points of Intersection?
题目大意:上面a个点,下面b个点,全部相连,问线有多少交点
解题思路:a个点取俩个 b个点取俩个,共有几种组合就是本题的解
#include <stdio.h>#include <iostream>using namespace std;long long int count(long long int x) { x = x * (x - 1); x = x / 2.0; return x;}int main() { long long int a; long long int b; int n = 0; while(scanf("%lld%lld", &a, &b) && (a + b) != 0) { long long int m; n++; if(a == 0 || b == 0) m = 0; else { m = count(a) * count(b); printf("Case %d: %lld\n", n, m); } } return 0;}
0 0
- UVa 10790 How Many Points of Intersection?
- uva 10790 How Many Points of Intersection?
- uva 10790 - How Many Points of Intersection?
- uva-10790-How Many Points of Intersection?
- UVa 10790 - How Many Points of Intersection?
- Uva 10790 - How Many Points of Intersection?
- UVa 10790 - How Many Points of Intersection?
- UVA 10790 How Many Points of Intersection?
- uva 10790 - How Many Points of Intersection
- uva 10790 How Many Points of Intersection?
- UVa 10790 How Many Points of Intersection?
- uva - 10790 - How Many Points of Intersection?
- UVa 10790 - How Many Points of Intersection?
- UVa 10790 - How Many Points of Intersection?
- Uva 10790 How Many Points of Intersection?
- UVA - 10790 How Many Points of Intersection?
- UVA - 10790 How Many Points of Intersection?
- uva 10790 How Many Points of Intersection?
- 【杭电oj】1207 - 汉诺塔II(打表,动态规划)
- 下拉刷新加载聊天记录出现的问题以及解决方法
- JVM环境参数配置
- svn cleanup failed–previous operation has not finished; run cleanup if it was interrupted
- Android N7.0多窗口适配开发指导
- UVA 10790-How Many Points of Intersection?#
- WebSphere MQ 入门指南
- Pykd——Python extension for WinDbg
- nginx.conf详解
- @PathVariable和@RequestParam的区别,理解 @PathVariable 、@RequestHeader、@CookieValue、@RequestParam, @Request
- 9. Palindrome Number
- leetcode:word-break
- ReactNative Demo - Navigator 使用
- mongoDB 入门指南、示例