PAT乙1001
我脑洞大了。。。。。
以为是个找规律。。。。。
原来只是模拟。。。。。
我相信肯定是有规律的。。。。。
但是我就是不愿意了。。。。。
#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<algorithm> using namespace std; int main()
{
int n;
int sum=;
cin >> n;
while (n!=)
{
if(n% == )
n/=;
else
n = (n*+)/;
sum++;
}
cout<<sum<<endl;
return ;
}
PAT乙1001的更多相关文章
- PAT (BL) 1001
链接:http://pat.zju.edu.cn/contests/pat-b-practise/1001 /* 1001. 害死人不偿命的(3n+1)猜想 (15) 卡拉兹(Callatz)猜想: ...
- PAT乙级 1001. 害死人不偿命的(3n+1)猜想 (15)
1001. 害死人不偿命的(3n+1)猜想 (15) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 卡拉兹(Ca ...
- PAT甲级 1001 A+B Format
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805528788582400 1001 A+B Format ( ...
- [C++]PAT乙级1001.害死人不偿命的(3n+1)猜想(15/15)
/* 1001.害死人不偿命的(3n+1)猜想 (15) 卡拉兹(Callatz)猜想: 对任何一个自然数n,如果它是偶数,那么把它砍掉一半:如果它是奇数,那么把(3n+1)砍掉一半.这样一直反复砍下 ...
- PAT Basic 1001
1001 害死人不偿命的(3n+1)猜想 (15 分) 卡拉兹(Callatz)猜想: 对任何一个正整数 n,如果它是偶数,那么把它砍掉一半:如果它是奇数,那么把 (3n+1) 砍掉一半.这样一直反复 ...
- PAT 甲级 1001 A+B Format (20)(20 分)
1001 A+B Format (20)(20 分) Calculate a + b and output the sum in standard format -- that is, the dig ...
- PAT 甲级1001 A+B Format (20)(C++ -思路)
1001 A+B Format (20)(20 分) Calculate a + b and output the sum in standard format -- that is, the dig ...
- PAT甲 1001. A+B Format (20) 2016-09-09 22:47 25人阅读 评论(0) 收藏
1001. A+B Format (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Calculate ...
- 【PAT】1001. A+B Format (20)
1001. A+B Format (20) Calculate a + b and output the sum in standard format -- that is, the digits m ...
随机推荐
- ios系统下的QQ浏览器jquert的BUG
$(document).bind("click", function(e){ var $t = $(e.target); alert(333); if($t.is("p& ...
- c# 操作word demo
/// <summary> /// 新创建word /// </summary> /// <param name="fileSaveDirectory" ...
- Spring框架--AOP编程
2 手动实现AOP编程 AOP 面向切面的编程, AOP可以实现"业务代码"与"关注点代码"分离 // 保存一个用户 public void add(User ...
- span设置宽和高当没有内容的时候也可以撑开
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- android代码格式化方法小结
转载:http://blog.csdn.net/androidzhaoxiaogang/article/details/7692526 Download the android-formatting. ...
- MyBatis学习-SQL 符号篇
当我们需要通过 XML 格式处理 SQL 语句时,经常会用到 <,<=,>,>= 等符号,但是很容易引起 XML 格式的错误,这样会导致后台将 XML 字符串转换为 XML文档 ...
- 错误记录-spring+mybatis
1.Syntax error on token "String", @ expected 解决:去掉类名后的括号 ps:这错误太二了 2.The nested type UserS ...
- c语言-猜数字游戏
#include <stdio.h> #include <stdlib.h> int top(); int input(); void main() { ; int numbe ...
- H5页面适配所有iPhone和安卓机型的六个技巧
http://www.th7.cn/web/html-css/201605/166006.shtml http://www.th7.cn/web/html-css/201601/153127.shtm ...
- Jersey客户端API调用REST风格的Web服务
Jersey 客户端 API 基础 jersey-1.14.jar 密码: cxug 要开始使用 Jersey 客户端 API,你首先需要创建一个 com.sun.jersey .api.client ...