H - H

Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u

Submit Status

Description

Sky从小喜欢奇特的东西,而且天生对数字特别敏感,一次偶然的机会,他发现了一个有趣的四位数2992,这个数,它的十进制数表示,其四位数字之和为2+9+9+2=22,它的十六进制数BB0,其四位数字之和也为22,同时它的十二进制数表示1894,其四位数字之和也为22,啊哈,真是巧啊。Sky非常喜欢这种四位数,由于他的发现,所以这里我们命名其为Sky数。但是要判断这样的数还是有点麻烦啊,那么现在请你帮忙来判断任何一个十进制的四位数,是不是Sky数吧。 
 

Input

输入含有一些四位正整数,如果为0,则输入结束。 
 

Output

若n为Sky数,则输出“#n is a Sky Number.”,否则输出“#n is not a Sky Number.”。每个结果占一行。注意:#n表示所读入的n值。 
 

Sample Input

2992 1234 0
 

Sample Output

2992 is a Sky Number. 1234 is not a Sky Number.

 #include<cstdio>
#include<cstring>
int main()
{
int n,m;
while(scanf("%d",&n)&&n!=)
{
m=n;
int num0=;
while(m>)
{
num0+=m%;
m/=;
}
m=n;
int num1=;
while(m>)
{
num1+=m%;
m/=;
}
m=n;
int num2=;
while(m>)
{
num2+=m%;
m/=;
}
if(num1==num0&&num1==num2)
{
printf("%d is a Sky Number.\n",n);
}
else
{
printf("%d is not a Sky Number.\n",n);
}
}
}

CDZSC_2015寒假新人(2)——数学 H的更多相关文章

  1. CDZSC_2015寒假新人(2)——数学 G

    G - G Time Limit:3000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  2. CDZSC_2015寒假新人(2)——数学 P

    P - P Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  3. CDZSC_2015寒假新人(2)——数学 D

    D - D Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  4. CDZSC_2015寒假新人(2)——数学 C

    C - C Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  5. CDZSC_2015寒假新人(2)——数学 B

    B - B Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  6. CDZSC_2015寒假新人(2)——数学 A

    A - A Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  7. CDZSC_2015寒假新人(1)——基础 h

    Description Ignatius was born in a leap year, so he want to know when he could hold his birthday par ...

  8. CDZSC_2015寒假新人(1)——基础 e

    Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever ...

  9. CDZSC_2015寒假新人(1)——基础 i

    Description “Point, point, life of student!” This is a ballad(歌谣)well known in colleges, and you mus ...

随机推荐

  1. C#如何设置下拉COMMBOX为不可输入,只有下拉条目

    设置下拉框的DropDownStyle属性为DropDownList

  2. hdu5348 MZL's endless loop(欧拉回路)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud MZL's endless loop Time Limit: 3000/1500 ...

  3. 安装laravel

    # 安装laravel 安装composer #安装 curl -sS https://getcomposer.org/installer | php #添加到PATH sudo mv compose ...

  4. web worker使用

    使用postMessage()方法传递信息.来自Worker的数据保存在event.data中.通过message和error事件与页面通信. <script> var data = [4 ...

  5. macbook安装mysql

    一.官网下载dmg文件 二.双击安装dmg文件,一路next: 三.

  6. AngularJS 通过 Spring Restful 上传文件

    总结一下,在写下这些文字之前心里很不爽,一个小问题倒腾了这么久...  JS 端: // 指令 app.directive('fileModel', ['$parse', function($pars ...

  7. Silverlight js html 相互调用

    1.sl调用js 比如我们在页面中定义一个js函数: <script type="text/javascript">        function fnTest(ms ...

  8. 使用CURL发彩信,短信和进行多线程

    短彩信发送 01 $xml_data = '<?xml version="1.0" encoding="UTF-8" standalone="y ...

  9. ExpandableListView 保证只展开一组

    expandableListView.setOnGroupExpandListener(new OnGroupExpandListener(){ @Override public void onGro ...

  10. Windows 8.1 Update1 6610 32位/64位下载、安装和新增功能简评

    今天,微软已经确认完成Windows 8.1 2014 Update RTM正式版的开发工作,累计修复99%的已知bug.随后,微软会将Win8.1首个春季更新正式版,即Win8.1 2014 Upd ...