mirror of
				https://github.com/ton-blockchain/ton
				synced 2025-03-09 15:40:10 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
	
		
			152 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
	
		
			152 B
		
	
	
	
		
			Text
		
	
	
	
	
	
int steps(int x) {
 | 
						|
  var n = 0;
 | 
						|
  while (x > 1) {
 | 
						|
    n += 1;
 | 
						|
    if (x & 1) {
 | 
						|
      x = 3 * x + 1;
 | 
						|
    } else {
 | 
						|
      x >>= 1;
 | 
						|
    }
 | 
						|
  }
 | 
						|
  return n;
 | 
						|
}
 |