dengcaiyun.blogspot.com
DCY's Notes: 五月 2009
http://dengcaiyun.blogspot.com/2009_05_01_archive.html
不用别人认可也不用别人理解,尽情去做自己认为应该做的事……. 发觉自己一只在浪费时间,一直在挥霍……. 还记得高中班主任田春霞那句“不为失败找理由,要为成功想办法”. 今天看了《我的青春谁做主》,里面某人的姥姥讲了一段很好的话:其实不是所有得到的结果都是成功,也不是没有结果的就是失败,成功藏在过程里,将来回头看,乐趣肯定不在撞线的那一下,结果就像是买东西的赠品,有了算白赚,没有也没什么……. The following iterative sequence is defined for the set of positive integers:. N → n/2 (n is even). N → 3n 1 (n is odd). Using the rule above and starting with 13, we generate the following sequence:. 13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1. Long int num,max=0,i,j,answer;. If(j%2= 0) {j=j/2;num ;}. 44274228...
dengcaiyun.blogspot.com
DCY's Notes: Problem 12--(c)
http://dengcaiyun.blogspot.com/2009/05/problem-12-c.html
不用别人认可也不用别人理解,尽情去做自己认为应该做的事……. The sequence of triangle numbers is generated by adding the natural numbers. So the 7 (th) triangle number would be 1 2 3 4 5 6 7 = 28. The first ten terms would be:. Let us list the factors of the first seven triangle numbers:. 10: 1,2,5,10. 15: 1,3,5,15. 21: 1,3,7,21. 28: 1,2,4,7,14,28. We can see that 28 is the first triangle number to have over five divisors. What is the value of the first triangle number to have over five hundred divisors? Long int result=0;.
dengcaiyun.blogspot.com
DCY's Notes: Problem 11
http://dengcaiyun.blogspot.com/2009/05/problem-11-22-february-2002-in-2020.html
不用别人认可也不用别人理解,尽情去做自己认为应该做的事……. In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08. 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00. 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65. 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91. 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80. 24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50. What is the greatest produc...
dengcaiyun.blogspot.com
DCY's Notes: Problem 10--(c)
http://dengcaiyun.blogspot.com/2009/05/problem-10-c.html
不用别人认可也不用别人理解,尽情去做自己认为应该做的事……. The sum of the primes below 10 is 2 3 5 7 = 17. Find the sum of all the primes below two million. Int primer(long int n). Long long int flag=1,i;. Long long j=3,sum=2;/*忽略了2,所以要加上2*/. Printf("%lld n",sum);. 标签: Project Euler. 订阅: 帖子评论 (Atom). 我是一名在广州读书的学生,喜欢IT……. Task-Based Language Teaching in Rural Junior English Teaching. Volition 郭 光景 :.
dengcaiyun.blogspot.com
DCY's Notes: Problem 14--(c)
http://dengcaiyun.blogspot.com/2009/05/problem-14-c.html
不用别人认可也不用别人理解,尽情去做自己认为应该做的事……. The following iterative sequence is defined for the set of positive integers:. N → n/2 (n is even). N → 3n 1 (n is odd). Using the rule above and starting with 13, we generate the following sequence:. 13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1. It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1. Long int num,max=0,i,j,answer;.
dengcaiyun.blogspot.com
DCY's Notes: 超长整数运算
http://dengcaiyun.blogspot.com/2009/05/blog-post_05.html
不用别人认可也不用别人理解,尽情去做自己认为应该做的事……. 基於記憶體的有效運用,程式語言中規定了各種不同的資料型態,也因此變數所可以表達的最大整數受到限制,例如 123456789123456789這樣的整數就不可能儲存在long變數中(例如C/C 等),我們稱這為long數,這邊翻為超長整數(避免與資 料型態的長整數翻譯混淆),或俗稱大數運算。 一個變數無法表示超長整數,則就使用多個變數,當然這使用陣列最為方便,假設程式語言的最大資料型態可以儲存至65535的數好了,為了計算方便及符合使用十進位制的習慣,讓每一個陣列元素可以儲存四個位數,也就是0到9999的數,例如:. 這樣的問題,解法就是使用程式中的乘法函式,至於要算到多大,就看需求了。 如果您使用的是Java,那麼在java.lang下有BigInteger與BigDecimal可以直接進行大數運算。 Void add(int *a, int *b, int *c) {. Int i, carry = 0;. For(i = N - 1; i = 0; i- ) {. C[i] = a[i] b[i] carry;. Carry = 0;.
dengcaiyun.blogspot.com
DCY's Notes: 时间……
http://dengcaiyun.blogspot.com/2009/05/blog-post_14.html
不用别人认可也不用别人理解,尽情去做自己认为应该做的事……. 发觉自己一只在浪费时间,一直在挥霍……. 还记得高中班主任田春霞那句“不为失败找理由,要为成功想办法”. 订阅: 帖子评论 (Atom). 我是一名在广州读书的学生,喜欢IT……. Task-Based Language Teaching in Rural Junior English Teaching. Volition 郭 光景 :.
dengcaiyun.blogspot.com
DCY's Notes: Problem 2--(c)
http://dengcaiyun.blogspot.com/2009/05/problem-2-c.html
不用别人认可也不用别人理解,尽情去做自己认为应该做的事……. Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:. Find the sum of all the even-valued terms in the sequence which do not exceed four million. Int f1=1,f2=2,sum=0,t;. Printf("%d n",sum);. 标签: Project Euler. 订阅: 帖子评论 (Atom). 我是一名在广州读书的学生,喜欢IT……. Task-Based Language Teaching in Rural Junior English Teaching. Volition 郭 光景 :.
dengcaiyun.blogspot.com
DCY's Notes: Problem 3--(c)
http://dengcaiyun.blogspot.com/2009/05/problem-3-02-november-2001-prime.html
不用别人认可也不用别人理解,尽情去做自己认为应该做的事……. The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143? Long long int num=600851475143,res=2;. Printf("%lld n",res);. Int prime(long long int n). Long long int i;. 标签: Project Euler. 订阅: 帖子评论 (Atom). 我是一名在广州读书的学生,喜欢IT……. Task-Based Language Teaching in Rural Junior English Teaching. Volition 郭 光景 :.
dengcaiyun.blogspot.com
DCY's Notes: Problem 9--(c)
http://dengcaiyun.blogspot.com/2009/05/problem-9-c.html
不用别人认可也不用别人理解,尽情去做自己认为应该做的事……. A Pythagorean triplet is a set of three natural numbers, a. A (2) b (2) = c (2). For example, 3 (2) 4 (2) = 9 16 = 25 = 5 (2). There exists exactly one Pythagorean triplet for which a b c = 1000. Find the product abc. Printf("%d n",i*j*(1000-i-j) ;. 标签: Project Euler. 订阅: 帖子评论 (Atom). 我是一名在广州读书的学生,喜欢IT……. Task-Based Language Teaching in Rural Junior English Teaching. Volition 郭 光景 :.