程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> 關於C語言 >> C解兩道題

C解兩道題

編輯:關於C語言

1.If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120. click

{20,48,52}, {24,45,51}, {30,40,50}

For which value of p <=1000, is the number of solutions maximised?

翻譯過來就是:

如果p是這樣一個數,滿足三元組{a,b,c}之和是p,且a,b,c能組成直角三角形的三個邊。當p=120的時候,且有三個解:

{20,48,52}, {24,45,51}, {30,40,50}

那麼在p<=1000以內,滿足以上條件的解的個數最多的p是幾?

答案:840.

{ code placeholder}

2.A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:

012 021 102 120 201 210

What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9? click

翻譯:A permutation is an ordered arrangement of objects。(大意就是排列的定義)比如,3124是數字1,2,3,4的一種可能排列。如果把所有的排列按照數字或者字母列出來,我們稱為字典順序。數字0,1,2的字典排序為:

012 021 102 120 201 210

那麼數字0,1,2,3,4,5,6,7,8,9的字典排序的第1000000(100萬)個排列數字是幾?

  答案:2783915460{ code placeholder}

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved