亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

蟲蟲首頁| 資源下載| 資源專輯| 精品軟件
登錄| 注冊

您現在的位置是:蟲蟲下載站 > 資源下載 > 數據結構 > 數字運算

數字運算

  • 資源大小:2 K
  • 上傳時間: 2015-05-21
  • 上傳用戶:wanghaihah
  • 資源積分:2 下載積分
  • 標      簽: 數字 運算

資 源 簡 介

數字運算,判斷一個數是否接近素數 A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no

相 關 資 源

主站蜘蛛池模板: 仁寿县| 平利县| 弥渡县| 聂荣县| 曲阳县| 山丹县| 浠水县| 博爱县| 苍山县| 社旗县| 勃利县| 扶沟县| 房产| 辰溪县| 平顺县| 互助| 襄城县| 马尔康县| 南京市| 高台县| 牙克石市| 四川省| 景德镇市| 怀化市| 沈丘县| 长沙市| 灵璧县| 榆林市| 水城县| 武强县| 偃师市| 青神县| 疏附县| 晋中市| 宾川县| 永川市| 渑池县| 博乐市| 晋江市| 汽车| 镇安县|