数据的交换输出 题目分析: 找到最小值,然后与第一个换位置 代码: #include<iostream> using namespace std; int main() { int n; int a[101]; while (cin >> n&&n) { int i,t, min = 99999; ...
分类:
其他好文 时间:
2020-02-08 10:15:34
阅读次数:
74
Question In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top-left to bottom-right has length k if and only i ...
分类:
其他好文 时间:
2020-02-08 09:49:52
阅读次数:
86
水仙花数 题目分析: 水仙花数也被称为超完全数字不变数(pluperfect digital invariant, PPDI)、自恋数、自幂数、阿姆斯壮数或阿姆斯特朗数(Armstrong number),水仙花数是指一个 3 位数,它的每个位上的数字的 3次幂之和等于它本身(例如:1^3 + 5^ ...
分类:
其他好文 时间:
2020-02-08 09:46:05
阅读次数:
65
蟠桃记 题目分析: 很普通的一道函数题,利用所给的条件,进行过程的模拟,构造出一个函数 代码: #include<iostream> using namespace std; int fun(int m) { int sum = 0; if (m == 1) { return 1; } else{ ...
分类:
其他好文 时间:
2020-02-08 09:37:27
阅读次数:
48
素数判定 题目分析: 构造一个判断素数的函数fun,利用fun函数判断区间内的素数。 代码: #include <iostream> #include <math.h> #define fun(n) n*n + n + 41 using namespace std; int prime(int n) ...
分类:
其他好文 时间:
2020-02-08 09:35:06
阅读次数:
74
字符串统计 题目分析: 录入字符串,判断数字有多少个,累加保存。 代码: #include<iostream> using namespace std; int main() { char a[100001]; int n; while (cin >> n&&n) { while (n--) { g ...
分类:
其他好文 时间:
2020-02-08 09:29:13
阅读次数:
51
多项式求和 题目分析: 一道经典的入门算法题,利用for循环以及-1的累乘,进行计算,代码如下 代码: #include<iostream> using namespace std; int main(){ int i, n; int t = 1; int cnt; double sum, num; ...
分类:
其他好文 时间:
2020-02-08 09:18:56
阅读次数:
48
#include<iostream> #include<algorithm> #include<cstring> using namespace std; const int maxn=110010; char t[maxn],s[maxn*3]; int p[maxn*3],lens; void ...
分类:
其他好文 时间:
2020-02-08 00:45:03
阅读次数:
77
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2085import java.util.Scanner;public class 核反应堆2085 { public static void main(String[] args) { Scanner inp ...
分类:
其他好文 时间:
2020-02-08 00:20:25
阅读次数:
62
hdu4773:http://acm.hdu.edu.cn/showproblem.php?pid=4773 题意:给你两个相离的圆,以及一个点,求所有和这两个圆相切,并且经过该点的圆。 我们先画出满足题意的圆,然后把这三个圆反演,给定的两个圆因为不经过p点,反演后是两个圆,然后ans圆经过p点,所 ...
分类:
其他好文 时间:
2020-02-06 18:07:21
阅读次数:
56