随笔分类 -  数学

hdu 1076(日期相关)
摘要:View Code /* Name: 日期相关 Copyright: Author: Try86 Date: 15/04/12 23:32 Description: */#include <cstdio>#include <iostream>using namespace std;bool isLeap(int year) { if (year%400==0 || year%4==0&&year%100!=0) return true; return false;} int main() { int t; scanf ("%d", & 阅读全文
posted @ 2012-04-16 07:34 Try86 阅读(240) 评论(0) 推荐(0)
hdu 1056(简单数学)
摘要:View Code /* Name: 简单数学 Copyright: Author: Try86 Date: 15/04/12 22:45 Description: */#include <cstdio>#include <iostream>using namespace std;int main() { double len; while (scanf("%lf", &len), len!=0.00) { double sum = 0; int i; for (i=2; sum<len; ++i) sum += 1.0/i;... 阅读全文
posted @ 2012-04-15 22:47 Try86 阅读(201) 评论(0) 推荐(0)
hdu 1201(日期计算)
摘要:/* Name: 日期计算 Author: Try_86 Date: 10/04/12 21:42*/#include <cstdio>#include <iostream>using namespace std;int days[13] = {0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};bool isLeap(int year) {//判断闰年 if ((year%400==0) || (year%4==0&&year%100!=0)) return true; return fa 阅读全文
posted @ 2012-04-10 21:45 Try86 阅读(326) 评论(0) 推荐(0)
hdu 1212(数学)
摘要:/* Name: 数学题 Author: Try_86 Date: 10/04/12 20:56*/#include <cstdio>#include <cstring>#include <iostream>using namespace std;int b;char a[1005];int solve() { int ans = 0; for (int i=0; a[i]; ++i) ans = (ans * 10 + a[i] - '0') % b; return ans; }int main() { while (scanf(" 阅读全文
posted @ 2012-04-10 20:58 Try86 阅读(153) 评论(0) 推荐(0)
hdu 1220(数学)
摘要://数学,没化简,直接用#include <cstdio>#include <iostream>using namespace std;int main() { int n; while (scanf("%d", &n) != EOF) { int s = n * n * n; int ans = (s-4)*4 + 6*(n-2)*(s-5) + 3*(n-2)*(n-2)*(s-6) + (n-2)*(n-2)*(n-2)*(s-7)/2; printf ("%d\n", ans); } return 0;} 阅读全文
posted @ 2012-04-04 20:04 Try86 阅读(162) 评论(0) 推荐(0)
hdu 1060(数学)
摘要://数学//参考______________白白の屋/*m=n^n,两边分别对10取对数得 log10(m)=n*log10(n),得m=10^(n*log10(n)),由于10的任何整数次幂首位一定为1,所以m的首位只和n*log10(n)的小数部分有关*/#include <cmath>#include <cstdio>#include <iostream>using namespace std;int main() { int t; scanf ("%d", &t); while (t--) { int n; scanf ( 阅读全文
posted @ 2012-04-04 16:58 Try86 阅读(206) 评论(0) 推荐(0)
hdu 1018(数学)
摘要:编辑器加载中/*由斯特林[striling]公式可得: lnN!=NlnN-N+0.5ln(2N*pi) log10(N!)=lnN!/ln(10) 一个数字的位数,由对数来求。log10() // 求以10为底的对数log() // 以e为底的对数*///数学题#include <cmath>#include <cstdio>#include <iostream>using namespace std;const double PI = 3.14159265;int main() { int t; scanf ("%d", &t 阅读全文
posted @ 2012-04-04 11:01 Try86 阅读(138) 评论(0) 推荐(0)
hdu 1014(数学)
摘要://数学题#include <cstdio>#include <iostream>using namespace std;int gcd(int a, int b) { return b ? gcd(b, a%b) : a;}int main() { int n, m; while (scanf("%d%d", &n, &m) != EOF) { printf ("%10d%10d", n, m); if (gcd(n, m) == 1) printf (" Good Choice\n\n"); 阅读全文
posted @ 2012-04-04 10:14 Try86 阅读(155) 评论(0) 推荐(0)
hdu 1013(数学)
摘要://数学题,循环周期为9#include <cstdio>#include <cstring>#include <iostream>using namespace std;char n[1005];int main() { while (scanf("%s", &n), strcmp(n, "0")!=0) { int sum = 0; int l =strlen(n); for (int i=0; i<l; ++i) { sum += n[i] - '0'; sum %= 9; } .. 阅读全文
posted @ 2012-04-04 09:58 Try86 阅读(129) 评论(0) 推荐(0)
hdu 1012(简单数学题)
摘要://简单数学题#include <cstdio>#include <iostream>using namespace std;int main() { int i; double s, sum; printf ("n e\n"); printf ("- -----------\n"); printf ("0 1\n"); printf ("1 2\n"); printf ("2 2.5\n"); printf ("3 2.666666667\n"); 阅读全文
posted @ 2012-04-04 09:09 Try86 阅读(167) 评论(0) 推荐(0)
hdu 1008(简单数学)
摘要://简单数学题#include <cstdio>#include <iostream>using namespace std;int main() { int n; while (scanf("%d", &n), n) { int time = 0; int one, two; one = 0; for (int i=0; i<n; ++i) { scanf ("%d", &two); if (one < two) time += (two - one) * 6; ... 阅读全文
posted @ 2012-04-04 08:20 Try86 阅读(186) 评论(0) 推荐(0)