hdu 1279 验证角谷猜想
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1279
- #include<stdlib.h>
- #include<time.h>
- #include <cstdio>
- #include <cstring>
- #include <cmath>
- #include <cstdlib>
- #include <ctime>
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <queue>
- #include <map>
- #include <set>
- #include <string>
- using namespace std;
- int main()
- {
- int num,n,flag;
- cin>>num;
- while(num--)
- {
- cin>>n;
- flag=;
- while(n!=)
- {
- if(n% == )
- {
- n=n/;
- }
- else
- {
- if(flag != )
- printf(" ");
- printf("%d",n);
- n=n*+;
- flag++;
- }
- }
- if(flag == )
- printf("No number can be output !");
- printf("\n");
- }
- return ;
- }
hdu 1279 验证角谷猜想的更多相关文章
- hdu 1279 验证角谷猜想(简单的模拟)
Problem Description 数论中有许多猜想尚未解决,其中有一个被称为“角谷猜想”的问题,该问题在五.六十年代的美国多个著名高校中曾风行一时,这个问题是这样描述的:任何一个大于一的自然数, ...
- 杭电 HDU 1279 验证角谷猜想
验证角谷猜想 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Sub ...
- 题解报告:hdu 1279 验证角谷猜想
Problem Description 数论中有许多猜想尚未解决,其中有一个被称为“角谷猜想”的问题,该问题在五.六十年代的美国多个著名高校中曾风行一时,这个问题是这样描述的:任何一个大于一的自然数, ...
- HDOJ 1279 验证角谷猜想
Problem Description 数论中有许多猜想尚未解决,其中有一个被称为"角谷猜想"的问题,该问题在五.六十年代的美国多个著名高校中曾风行一时,这个问题是这样描述的:任何 ...
- hdu 验证角谷猜想 1279
Problem Description 数论中有许多猜想尚未解决,其中有一个被称为"角谷猜想"的问题,该问题在五.六十年代的美国多个著名高校中曾风行一时,这个问题是这样描述的:任何 ...
- 验证角谷猜想(hd1279)
验证角谷猜想 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Subm ...
- Openjudge计算概论-角谷猜想
/*===================================== 角谷猜想 总时间限制: 1000ms 内存限制: 65536kB 描述 所谓角谷猜想,是指对于任意一个正整数,如果是奇数 ...
- POJ C程序设计进阶 编程题#2:角谷猜想
编程题#2:角谷猜想 来源: POJ(Coursera声明:在POJ上完成的习题将不会计入Coursera的最后成绩.) 注意: 总时间限制: 1000ms 内存限制: 65536kB 描述 所谓角谷 ...
- Openjudge-计算概论(A)-角谷猜想
描述: 所谓角谷猜想,是指对于任意一个正整数,如果是奇数,则乘3加1,如果是偶数,则除以2,得到的结果再按照上述规则重复处理,最终总能够得到1.如,假定初始整数为5,计算过程分别为16.8.4.2.1 ...
随机推荐
- [codeforces 339]D. Xenia and Bit Operations
[codeforces 339]D. Xenia and Bit Operations 试题描述 Xenia the beginner programmer has a sequence a, con ...
- [codeforces 339]C. Xenia and Weights
[codeforces 339]C. Xenia and Weights 试题描述 Xenia has a set of weights and pan scales. Each weight has ...
- c++ 字符串流 sstream(常用于格式转换) 【转载】
使用stringstream对象简化类型转换C++标准库中的<sstream>提供了比ANSI C的<stdio.h>更高级的一些功能,即单纯性.类型安全和可扩展性.在本文中, ...
- Shape + Selector: Make a Shape as one item of the Selector
Generally, I use a selector to select pictures or colors to render the normal and the pressed backgr ...
- 阻止a标签默认跳转事件
1:<a href="####"></a> 2:<a href="javascript:void(0)"></a> ...
- php之aop实践
aop简介 AOP为Aspect Oriented Programming的缩写,意为:面向切面编程(也叫面向方面),可以通过预编译方式和运行期动态代理实现在不修改源代码的情况下给程序动态统一添加功能 ...
- 【GoLang】GoLang UTF8 与 Unicode
结论: 通用的UTF8编码可是Ken Thompson和Rob Pike共同发明的, 他们都是Go的作者. Go中rune对应unicode的码点, string只是UTF8编码.len(" ...
- VirtualBox中安装Ubuntu12.04/Ubuntu14.04虚拟机
NOTE: 一开始安装的Ubuntu12.04,后来又重新安装了14.04.截图基本使用了安装12.04时的截图,后来安装14.04时又补充了几张.该安装过程对Ubuntu12.04和14.04都是适 ...
- HTML 返回顶部的样式
.fhdb{ width:50px; height:50px; position:fixed; //可以用来定义元素的固定定位. right:20px; //距离右侧20像素 botto ...
- Java for LeetCode 222 Count Complete Tree Nodes
Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from W ...