PAT (Basic Level) Practise (中文)1001
来源:互联网 发布:淘宝一件代发靠谱吗 编辑:程序博客网 时间:2024/05/16 18:44
#include<stdio.h>int main(){int n,i = 0;scanf("%d", &n);while(n!=1){if (n % 2 == 0){n = n / 2;}else{n = (3 * n + 1) / 2;}i++;}printf("%d", i);return 0;}
最初while里的表达式为n>2,当n=1的时候有错,显示部分正确,修正后正确通过
阅读全文
0 0
- PAT (Basic Level) Practise (中文)--1001
- PAT (Basic Level) Practise (中文)1001
- PAT (Basic Level) Practise (中文)
- PAT (Basic Level) Practise (中文)
- PAT (Basic Level) Practise (中文)
- PAT (Basic Level) Practise (中文)1002
- PAT (Basic Level) Practise (中文) 1007
- PAT (Basic Level) Practise 1001
- PAT Basic level practise 1001
- PAT (Basic Level) Practise-1001
- PAT (Basic Level) Practise 1001
- PAT(Basic Level)Practise-----1001
- PAT (Basic Level) Practise (中文)—— 1004. 成绩排名
- PAT (Basic Level) Practise (中文)1004. 成绩排名 (20)
- PAT (Basic Level) Practise (中文)1009. 说反话 (20)
- PAT (Basic Level) Practise (中文)1026. 程序运行时间
- PAT (Basic Level) Practise (中文)1012. 数字分类 (20)
- PAT (Basic Level) Practise (中文)1013. 数素数 (20)
- Java23种设计模式——建造者模式
- Shell脚本中判断输入变量或者参数是否为空的方法
- 小程序 淘票票+node.js模拟本地数据
- 浏览器使用代理
- 1018. 锤子剪刀布 (20)
- PAT (Basic Level) Practise (中文)1001
- Js判断IE浏览器版本11、10、9、8、7、6.....
- 已知转换参数前提下的坐标转换操作方法
- ZigBee_CC2530_0DH_关于协议栈时钟的一些记录
- 深度解剖dubbo源码
- Cache之过: 网页或头像 无法 同步更新
- nginx线上问题记录
- Unity射线基础技巧附加检测的小例子(Unity萌新的备忘录)
- 机器学习实战K-means