源码工程 数据结构 人工审核无毒

数字运算

所属分类 数据结构
文件大小 2 K
文件格式 RAR 文件
累计下载 115 次
分享作者
发布日期

资料详细技术说明

数字运算,判断一个数是否接近素数 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

压缩包内文件清单(共 3 个文件)

已自动扫描归档包内目录结构与文件清单 源码与文本文档支持点击「在线阅读」,二进制/媒体文件请下载压缩包后使用
1 FILE
说明.txt 832 B
包内组件
2 FILE
1014.cpp 372 B
包内组件
3 FILE
新建 文本文档.txt 32 B
包内组件

相关数据结构资料推荐

下载与解压说明

下载积分规则

  • 本资源下载仅需 2 积分
  • 24 小时内重复下载免扣积分
  • VIP 会员享专属免积分高速通道

文件解压指南

  • 推荐使用 7-Zip 或新版 WinRAR 解压
  • 原理图与 PCB 请使用对应 EDA 软件打开
  • 压缩包内源码可直接在上方在线预览

免费获取积分