亚洲欧美第一页_禁久久精品乱码_粉嫩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

相 關 資 源

主站蜘蛛池模板: 耒阳市| 革吉县| 蒙阴县| 潼南县| 濉溪县| 和平区| 砀山县| 汪清县| 东至县| 山阴县| 四子王旗| 无极县| 池州市| 泰顺县| 鹤庆县| 会东县| 交城县| 南靖县| 漳州市| 苍南县| 青阳县| 阿尔山市| 阳高县| 锦屏县| 始兴县| 涟源市| 如皋市| 涡阳县| 万宁市| 三门峡市| 南康市| 从化市| 白水县| 获嘉县| 北海市| 秦皇岛市| 无棣县| 南京市| 右玉县| 广宗县| 永胜县|