首页 > > 详细

辅导CS之largest Fibonacci number & obtain a long string S from a URL

Problem 1:Write a program that runs for exactly 10 seconds.The objective of the program is to calculate the largest Fibonacci number within the time period.At the end, the program should output which Fibonacci number it has calculated to and the number itself. The first 10 Fibonacci numbers are: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34.For example, if your program calculated the 10th number when the time is up, it should output the following:The 10th Fibonacci number is 34.Heavily commented code that explains intent will be favoured over lightly commented code. Problem2:Write a program to obtain a long string S from a URL.You can assume that all characters in S belong in the set [a-z].Print out all unique palindromic substrings of S i.e. the substrings must all be different palindromes. On the last line, print the number of unique palindromes your program has found.Heavily commented code that explains intent will be favoured over lightly commented code.
 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!