mirror of
				https://github.com/krahets/hello-algo.git
				synced 2025-11-04 06:07:20 +08:00 
			
		
		
		
	Sync the while loop in iteration.cs with other languages (#746)
This commit is contained in:
		@ -36,9 +36,9 @@ public class iteration {
 | 
			
		||||
        // 循环求和 1, 2, 4, 5...
 | 
			
		||||
        while (i <= n) {
 | 
			
		||||
            res += i;
 | 
			
		||||
            i += 1; // 更新条件变量
 | 
			
		||||
            res += i;
 | 
			
		||||
            i *= 2; // 更新条件变量
 | 
			
		||||
            // 更新条件变量
 | 
			
		||||
            i += 1; 
 | 
			
		||||
            i *= 2;
 | 
			
		||||
        }
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user