杭电 2097 sky数
Sky数
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 24146 Accepted Submission(s): 13701
1234
0
1234 is not a Sky Number.
#include <iostream>
#include<math.h>
#include <iomanip>
#include<cstdio>
#include<string>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<stdlib.h>
#include<iterator>
#include<sstream>
#include<string.h>
using namespace std; int main()
{
int n;
while(cin>>n)
{
if(n==)
{
break;
}
int a1[];
int a2[];
int a3[];
memset(a1,,*sizeof(int));
memset(a2,,*sizeof(int));
memset(a3,,*sizeof(int)); int temp10=n;
int i=;
while(temp10>)
{
a1[i]=temp10%;
temp10=temp10/;
i--;
} int temp12=n;
i=;
while(temp12>)
{
a2[i]=temp12%;
temp12=temp12/;
i--;
} int temp16=n;
i=;
while(temp16>)
{
a3[i]=temp16%;
temp16=temp16/;
i--;
} int cnt10=;
int cnt12=;
int cnt16=; for(int j=;j<;j++)
{
cnt10=a1[j]+cnt10;
cnt12=a2[j]+cnt12;
cnt16=a3[j]+cnt16;
}
/*
cout<<cnt10<<endl;
cout<<cnt12<<endl;
cout<<cnt16<<endl;
*/
if(cnt10==cnt12&&cnt10==cnt16&&cnt12==cnt16)
{
cout<<n<<" is a Sky Number."<<endl;
}
else
{
cout<<n<<" is not a Sky Number."<<endl;
} }
return ;
}
杭电 2097 sky数的更多相关文章
- 杭电------2097 Sky数(C语言写)
//这个题没有一次过,哈哈哈哈,题意理解错了,开始还以为是必须加起来等于22呢 //其实就是依次算出个进制下的和,虽然每个循环最多循环四次,但是还是加上必要的判断,想办法让 //提前结束 #inclu ...
- HDU 2097 Sky数
http://acm.hdu.edu.cn/showproblem.php?pid=2097 Problem Description Sky从小喜欢奇特的东西,而且天生对数字特别敏感,一次偶然的机会, ...
- hdoj 2097 Sky数
Sky数 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- HDOJ(HDU) 2097 Sky数(进制)
Problem Description Sky从小喜欢奇特的东西,而且天生对数字特别敏感,一次偶然的机会,他发现了一个有趣的四位数2992,这个数,它的十进制数表示,其四位数字之和为2+9+9+2=2 ...
- hdu 2097 sky数(进制转换)
Sky数 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- HDU 2097 sky数 (进制转化)
传送门: Sky数 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
- HDU 2097 Sky数 进制转换
解题报告:这题就用一个进制转换的函数就可以了,不需要转换成相应的进制数,只要求出相应进制的数的各位的和就可以了. #include<cstdio> #include<string&g ...
- ACM 杭电HDU 2084 数塔 [解题报告]
数塔 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submissi ...
- 杭电oj2031、2033、2070、2071、2075、2089、2090、2092、2096-2099
2031 进制转换 #include<stdio.h> #include<string.h> int main(){ int n,i,r,x,j,flag; ]; while ...
随机推荐
- Books Exchange (hard version)
The only difference between easy and hard versions is constraints. There are nn kids, each of them i ...
- ansible笔记(5):常用模块之命令类模块
1.command模块 它的作用是帮助我们在远程主机上执行命令. [注意]使用command模块在远程主机中执行命令时,不会经过远程主机的shell处理,在使用command模块时,如果需要执行的命令 ...
- Unity Coroutine详解(二)
• 介绍• Part 1. 同步等待• Part 2. 异步协程• Part 3. 同步协程• Part 4. 并行协程 1.介绍 ...
- 2019 ICPC 徐州网络赛 B.so easy (并查集)
计蒜客链接:https://nanti.jisuanke.com/t/41384 题目大意:给定n个数,从1到n排列,其中有q次操作,操作(1) 删除一个数字 // 操作(2)求这个数字之后第一个没有 ...
- SCROLLINFO结构详解
在刚开始使用SCROLLINFO结构时感觉很不顺手,尤其其中的成员fMask理解不太深刻,经过查询资料才理解一二. 在使用滚动条功能时,如果要设置它的范围和位置可以用以前的函数,例如:SetScrol ...
- [单片机] ESP8266 开机自动透传
AT+CWMODE=1//设置WiFi工作在透传模式 AT+CWJAP_DEF="XX","YYY"//设置要链接的wifi名称.密码,并进行连接 //设置TC ...
- 【C语言】将两个字符串连接起来
#include<stdio.h> int main() { ] = "I "; ] = "am a student"; int i, j, n; ...
- 记一道简单的re--BUUctf reverse1
1.首先拖进ida里,看到了左面一百多function...还是shift+f12 查看敏感字符串吧 2.发现了这两个比较可疑的字符串,然后双击this is the right flag 进入到了他 ...
- Visual Studio 2017进行Python开发环境的搭建,使用VS2017进行python代码的编写。
Visual Studio 2017进行Python开发环境的搭建,使用VS2017进行python代码的编写. 前提:已经安装过VS2017且进行过配置. 第一部分: Python环境的搭建: 建议 ...
- 最大m段子段和 Day9 - E - Max Sum Plus Plus HDU - 1024
Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we ...