PAT 1001
来源:互联网 发布:女性 音乐家 知乎 编辑:程序博客网 时间:2024/05/25 20:00
#include<iostream>using namespace std;int main() { int i,temp=0; cin >> i; while (i != 1) { if (i % 2) {//jishu i = (3 * i + 1) / 2; temp++; } else { i = i / 2; temp++; } } cout << temp << endl; return 0;}
阅读全文
0 0
- pat 1001
- pat 1001
- PAT 1001
- PAT 1001
- PAT 1001
- PAT 1001
- PAT 1001
- PAT 1001
- PAT 1001
- PAT 1001
- PAT-1001
- PAT 1001
- PAT 1001
- PAT 1001
- PAT-1001
- PAT 1001
- PAT (BL) 1001
- PAT 1001-1010 题解
- ArcGIS Earth数据小析
- #leetcode#500 Keyboard Row
- shader
- [提交答案题] UOJ #109 【APIO2013】TASKSAUTHOR
- shader2
- PAT 1001
- 一个神奇的???whatever~~
- PAT 1002
- Build VIM&GVIM Executables on Windows
- leetcode-11. Container With Most Water
- 设计模式之工厂方法模式
- iOS 笔试题02~[有答案]
- c++中测试程序运行时间的方案
- C++静态成员