题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1279

  1. #include<stdlib.h>
  2. #include<time.h>
  3. #include <cstdio>
  4. #include <cstring>
  5. #include <cmath>
  6. #include <cstdlib>
  7. #include <ctime>
  8. #include <iostream>
  9. #include <algorithm>
  10. #include <vector>
  11. #include <queue>
  12. #include <map>
  13. #include <set>
  14. #include <string>
  15. using namespace std;
  16.  
  17. int main()
  18. {
  19. int num,n,flag;
  20. cin>>num;
  21. while(num--)
  22. {
  23. cin>>n;
  24. flag=;
  25. while(n!=)
  26. {
  27. if(n% == )
  28. {
  29. n=n/;
  30. }
  31.  
  32. else
  33. {
  34. if(flag != )
  35. printf(" ");
  36. printf("%d",n);
  37. n=n*+;
  38. flag++;
  39. }
  40.  
  41. }
  42. if(flag == )
  43. printf("No number can be output !");
  44. printf("\n");
  45. }
  46. return ;
  47. }

hdu 1279 验证角谷猜想的更多相关文章

  1. hdu 1279 验证角谷猜想(简单的模拟)

    Problem Description 数论中有许多猜想尚未解决,其中有一个被称为“角谷猜想”的问题,该问题在五.六十年代的美国多个著名高校中曾风行一时,这个问题是这样描述的:任何一个大于一的自然数, ...

  2. 杭电 HDU 1279 验证角谷猜想

    验证角谷猜想 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Sub ...

  3. 题解报告:hdu 1279 验证角谷猜想

    Problem Description 数论中有许多猜想尚未解决,其中有一个被称为“角谷猜想”的问题,该问题在五.六十年代的美国多个著名高校中曾风行一时,这个问题是这样描述的:任何一个大于一的自然数, ...

  4. HDOJ 1279 验证角谷猜想

    Problem Description 数论中有许多猜想尚未解决,其中有一个被称为"角谷猜想"的问题,该问题在五.六十年代的美国多个著名高校中曾风行一时,这个问题是这样描述的:任何 ...

  5. hdu 验证角谷猜想 1279

    Problem Description 数论中有许多猜想尚未解决,其中有一个被称为"角谷猜想"的问题,该问题在五.六十年代的美国多个著名高校中曾风行一时,这个问题是这样描述的:任何 ...

  6. 验证角谷猜想(hd1279)

    验证角谷猜想 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Subm ...

  7. Openjudge计算概论-角谷猜想

    /*===================================== 角谷猜想 总时间限制: 1000ms 内存限制: 65536kB 描述 所谓角谷猜想,是指对于任意一个正整数,如果是奇数 ...

  8. POJ C程序设计进阶 编程题#2:角谷猜想

    编程题#2:角谷猜想 来源: POJ(Coursera声明:在POJ上完成的习题将不会计入Coursera的最后成绩.) 注意: 总时间限制: 1000ms 内存限制: 65536kB 描述 所谓角谷 ...

  9. Openjudge-计算概论(A)-角谷猜想

    描述: 所谓角谷猜想,是指对于任意一个正整数,如果是奇数,则乘3加1,如果是偶数,则除以2,得到的结果再按照上述规则重复处理,最终总能够得到1.如,假定初始整数为5,计算过程分别为16.8.4.2.1 ...

随机推荐

  1. [codeforces 339]D. Xenia and Bit Operations

    [codeforces 339]D. Xenia and Bit Operations 试题描述 Xenia the beginner programmer has a sequence a, con ...

  2. [codeforces 339]C. Xenia and Weights

    [codeforces 339]C. Xenia and Weights 试题描述 Xenia has a set of weights and pan scales. Each weight has ...

  3. c++ 字符串流 sstream(常用于格式转换) 【转载】

    使用stringstream对象简化类型转换C++标准库中的<sstream>提供了比ANSI C的<stdio.h>更高级的一些功能,即单纯性.类型安全和可扩展性.在本文中, ...

  4. 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 ...

  5. 阻止a标签默认跳转事件

    1:<a href="####"></a> 2:<a href="javascript:void(0)"></a> ...

  6. php之aop实践

    aop简介 AOP为Aspect Oriented Programming的缩写,意为:面向切面编程(也叫面向方面),可以通过预编译方式和运行期动态代理实现在不修改源代码的情况下给程序动态统一添加功能 ...

  7. 【GoLang】GoLang UTF8 与 Unicode

    结论: 通用的UTF8编码可是Ken Thompson和Rob Pike共同发明的, 他们都是Go的作者. Go中rune对应unicode的码点, string只是UTF8编码.len(" ...

  8. VirtualBox中安装Ubuntu12.04/Ubuntu14.04虚拟机

    NOTE: 一开始安装的Ubuntu12.04,后来又重新安装了14.04.截图基本使用了安装12.04时的截图,后来安装14.04时又补充了几张.该安装过程对Ubuntu12.04和14.04都是适 ...

  9. HTML 返回顶部的样式

    .fhdb{ width:50px; height:50px; position:fixed;   //可以用来定义元素的固定定位. right:20px;      //距离右侧20像素 botto ...

  10. 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 ...