The 3n + 1 problem (C语言代码) 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int fun(int n){ int k=1; if(n==1) { return k; } while(n!=1) {…… 题解列表 2017年07月26日 0 点赞 0 评论 900 浏览 评分:0.0
The 3n + 1 problem (C语言代码) 摘要:解题思路:很简单的一道题,跟着题目描述的思路写就可以了。注意事项:需要注意的是,输入的i不一定小于j!参考代码:#include <stdio.h> int getCycle(long long…… 题解列表 2017年10月11日 0 点赞 0 评论 688 浏览 评分:0.0
The 3n + 1 problem (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main(){ int i,j=0,n[100],m[100],count=0,sum[100]={0},k=0,a=0…… 题解列表 2017年10月22日 0 点赞 0 评论 705 浏览 评分:0.0
The 3n + 1 problem (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){int i,j;while(~scanf("%d%d",&i,&j)){ int count1=1,count_m…… 题解列表 2017年12月11日 1 点赞 0 评论 578 浏览 评分:0.0
The 3n + 1 problem (C语言代码) 摘要:解题思路:好吧,承认自己英语阅读能力菜的抠脚,CE了两次,才发现这句话,you are to determine the maximum cycle length over all numbers b…… 题解列表 2017年12月13日 0 点赞 0 评论 749 浏览 评分:0.0
我美吗! 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main() { long long int m,n,i,j,s,max,t; while(scanf("%…… 题解列表 2017年12月14日 0 点赞 0 评论 648 浏览 评分:0.0
WU-The 3n + 1 problem (C语言代码) 摘要:参考代码:#include<stdio.h> int fenjie(int a) { int i=0; while(a!=1) { if(a%2==0) { a=a/2;…… 题解列表 2017年12月17日 1 点赞 0 评论 772 浏览 评分:0.0
The 3n + 1 problem (C++代码) principle's simple c++ 摘要:解题思路:注意事项:此题有两个坑点:第一,并没有说i一定小于j第二,在输入后就应该立刻输出,否则对ij处理完之后就会出错。当然,用户体验用脚趾头想一下都知道非常糟糕。参考代码:#include <io…… 题解列表 2017年12月21日 1 点赞 0 评论 922 浏览 评分:0.0
The 3n + 1 problem (C语言代码) 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Demo { public static int print(int n) { …… 题解列表 2018年01月28日 0 点赞 0 评论 562 浏览 评分:0.0
The 3n + 1 problem (C++代码) 摘要:解题思路:为了采用规范化编程,建议把那个3n+1猜想写进一个函数,返回值是每个传入的数的循环长度。这个题思路也很简单,就是输入对于每次输入的i,j,先输出i,j,然后判断一下i和j的大小,始终让i保存…… 题解列表 2018年01月29日 0 点赞 0 评论 737 浏览 评分:0.0