Skynumber
64-bit integer IO format: Java class name:
Input
Output
Sample Input
2992
1234
0
Sample Output
2992 is a Sky Number.
1234 is not a Sky Number.
代码:
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <iostream>
#include <ctype.h>
#include <iomanip>
#include <queue>
#include <map>
#include <stdlib.h> using namespace std; int sum_k(int n,int k)
{
int s=;
while(n!=)
{
s+=n%k;
n/=k;
}
return s;
}
int main()
{
int n;
while(~scanf("%d",&n)){
if(n==)
break;
int a,b,c;
a=sum_k(n,);
b=sum_k(n,);
c=sum_k(n,);
if(a==b&&a==c)
printf("%d is a Sky Number.\n",n);
else
printf("%d is not a Sky Number.\n",n);
}
}
Skynumber的更多相关文章
随机推荐
- Harry Potter and the Prisoner of Azkaban
称号:Harry Potter and the Prisoner of Azkaban 作者:J.K. Rowling 篇幅: 448页 蓝思值:880L 用时: 11天 工具: 有道词典 [ ...
- sql二进制数据权限
(3为权限组合值,结果为1=列表 2=新建 4=修改 8=删除) select 3 & 1 select 3 & 2 select 3 & 4 select 3 & 2 ...
- LeetCode: Distinct Subsequences [115]
[称号] Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequ ...
- Maven学习笔记(十一年):柔性结构
一个典型的项目将是开发环境.测试环境和生产环境,这些环境的数据库配置是不一样的,并使用正确的配置. Maven为了支持构建的灵活性,内置了三大特性,即属性.Profile和资源过滤.本章将介绍这些特性 ...
- Android学习路径(两)项目文件本身使用场景和文件演示
ios讨论群1群:135718460 1.src文件:java源码存放文件夹 2.gen 文件:自己主动生成全部由android开发工具自己主动生成的文件,文件夹中最重要的就是R.java文件,这个 ...
- JS弄ASP.NET(C#)在页GridView信息选择行
做web发展还是新手我,为了之前获得Gridview中间值,它是通过服务器端控件通过第一Gridview将数据保存到服务器,当一个服务器,然后绑定的隐藏字段,在通过的js阅读隐藏字段值,如今,这种方法 ...
- JSP 获得Spring 注射对象
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils"%&g ...
- TextView于getCompoundDrawables()使用演示样本的方法
MainActivity例如下列: package cc.testcompounddrawables; import android.app.Activity; import android.grap ...
- 中颖电子AD操作
#define ADC_DIS 0 #define ADC_ENB 1 //ADC通道号定义 #define ADC_Chanel0 (unsigned char)(0x00<<1) #d ...
- POJ 2208 已知边四面体六个长度,计算体积
Pyramids Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2718 Accepted: 886 Special ...