标签:
卡拉兹(Callatz)猜想:5
#include <iostream> using namespace std; int main(){ int n; cin >> n; int cnt = 0; while (n != 1){ if (n % 2 == 0){ n = n / 2; } else{ n = (3 * n + 1) / 2; } cnt++; } cout << cnt << endl; return 0; }
PAT乙级1001题:害死人不偿命的(3n+1)猜想 (15)
标签:
原文地址:http://blog.csdn.net/rabbit_911009/article/details/51332388