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 ...
随机推荐
- Dash:程序员的好帮手
Dash 关于Dash是什么.有哪些功能以及该怎么使用,我想直接引用咖啡 生活 美女蛇,这位小伙伴整理的很详细,我这里只说一下Dash的破解方法. 破解 破解补丁下载:Dash3.x_Cracked ...
- 学习笔记——迭代器模式Iterator
迭代器模式,使用很多,但是很少实现.常用的集合都支持迭代器. 集合中的CreateIterator()可用于创建自己的迭代器,在里面通过调用迭代器的构造函数Iterator(Aggregate)来绑定 ...
- Nexus Maven 私服搭建
1.下载Nexus安装文件:http://www.sonatype.org/nexus/go ,目前是nexus-2.13.0-01-bundle.tar.zip这个最新版本: 2.解压到任意目录,我 ...
- git变基--rebase
变基过程: 两个分支 先考虑不用变基的合并: $ git checkout master $ git merge experiment 合并后: 如果变基:(以下为变基过程) $ git checko ...
- JavaScript高级程序设计:第十四章
第十四章 一.表单的基础知识 在HTML中,表单是由<form>元素来表示的,而在javascript中,表单对应的则是HTMLFormElement类型.HTMLFormElement继 ...
- string 转 int,int 转 string
string str="12345"; int b=atoi(str.c_str()); 可以配合atof,转为double char buf[10]; sprintf(buf, ...
- 二分 Intel Code Challenge Elimination Round (Div.1 + Div.2, combined) D
http://codeforces.com/contest/722/problem/D 题目大意:给你一个没有重复元素的Y集合,再给你一个没有重复元素X集合,X集合有如下操作 ①挑选某个元素*2 ②某 ...
- WPF之TabControl控件用法
先创建实体基类:NotificationObject(用来被实体类继承) 实现属性更改通知接口: using System; using System.Collections.Generic; usi ...
- Setup a private http/nginx based GIT server
原文:http://aaba.me/blog/2014/03/setup-a-private-http-nginx-based-git-server.html https://doomzhou.git ...
- FileSystemXmlApplicationContext方法的绝对路径问题
public AgentServer(Socket c,String confDir) { this.client = c; ApplicationContext ac = new FileSyste ...