URAL 1963 Kite 四边形求对称轴数】的更多相关文章

题目链接: http://acm.timus.ru/problem.aspx?space=1&num=1963 题意,顺时针或逆时针给定4个坐标,问对称轴有几条,输出(对称轴数*2) 对于一条对角线,若他是对称轴,必须满足:另外2点关于这条对角线对称  => 2条对角线互相垂直且 与这条对角线形成的夹角相等 而对于每条边的中点,只需要证明中点相连后与其所在的边垂直即可,垂直且相等就可以证明是对称的 #include <iostream> #include <string&g…
Kite 题目连接: http://acm.hust.edu.cn/vjudge/contest/123332#problem/C Description Vova bought a kite construction kit in a market in Guangzhou. The next day the weather was good and he decided to make the kite and fly it. Manufacturing instructions, of c…
前文链接:帮初学者改代码——playerc之“练习:求完数问题”(上) 再来看看be_ferfect()应该如何改. be_ferfect()函数的功能是判断number是否为完数,同时把因子对写入divisers数组.以28这个完数为例,在数组中将依次写入 1 28 2 14 4 7 输出时则按要求依大小次序输出 1 2 4 7 14.先从前跳到后,到头之后掉头,再从后跳到前. 这种写入的方式决定了输出代码写起来要困难一些.如果希望输出写得容易些的话,写入时就必须改变这种图省事的办法. 有很多…
原文:“练习:求完数问题” 原代码: // #include <stdio.h> #include <stdlib.h> #include <math.h> #define DIVISERS_MAX_LENGTH (1024) #define TOP (10000) int main(void) { /* * 储存因子,成对的储存.例如6 * 1,6, 2,3 */ int divisers[DIVISERS_MAX_LENGTH] = {0}; int diviser…
// GetWanShu.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include "omp.h" #include <Windows.h> #include "time.h" //函数声明 void getWanShuBySection(); void getWanShu(); void getWanShuByReduction(); int _tmain(int argc, _TCH…
内容: 求两数的整数商 和 商 ,商保留两位小数 输入说明: 一行 两个整数 输出说明: 一行,一个整数,一个实数(两位小数) 输入样例:   12 8 输出样例 : 1 1.50 #include <stdio.h> int main(void) { ; ; scanf("%f %f", &num1, &num2); printf("%d %.2f", (int)(num1 / num2), num1 / num2); ; } 或者 #…
内容: 求两数的整数商 和 余数 输入说明: 一行两个整数 输出说明: 一行两个整数 输入样例:   18 4 输出样例 : 4 2 #include <stdio.h> int main(void) { ; ; scanf("%d %d", &num1, &num2); printf("%d %d", num1 / num2, num1 % num2); ; }…
Under Attack II Time Limit: 5 Seconds      Memory Limit: 65536 KB Because of the sucessfully calculation in Under Attack I, Doctor is awarded with Courage Cross and promoted to lieutenant. But the war seems to end in never, now Doctor has a new order…
求数组的最小值和最大值 //求数组当中最大值和最小值 var arr=[3,2,6,1,45,23,456,23,2,6,3,45,37,89,30]; //第一种方法 根据排序方法来求最大值和最小值 从小到大排序 第0位就是最小值 最后一位就是最大值 arr.sort(function(a,b){ return a-b; //按从小大的情况排序 //return b-a; 按从大到小的情况排序 }) console.log(arr); var min=arr[0]; var max=arr[a…
要求:求一组数中的最大值和最小值,以及所在位置 代码实现: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv=&…