标签:image 奶牛 color scanf usaco int http com blog
1 #include <cstdio> 2 #include <algorithm> 3 4 int n; 5 int tot; 6 7 int main(){ 8 scanf("%d",&n); 9 while(n!=1){ 10 if(n%2!=0){ 11 n=n*3+1; 12 tot++; 13 } 14 else if(n%2==0){ 15 n>>=1; 16 tot++; 17 } 18 } 19 printf("%d\n",tot); 20 }
标签:image 奶牛 color scanf usaco int http com blog
原文地址:http://www.cnblogs.com/OIerLYF/p/7496003.html