开发者

convert a Pseudocode into c# code

开发者 https://www.devze.com 2023-01-31 12:26 出处:网络
i have a very simple question,how can i convert and use this Pseudocode in c# code? repeat i=i+1; until x[i]>=j

i have a very simple question,how can i convert and use this Pseudocode in c# code?

repeat
 i=i+1;
 until x[i]>=j

i mean what code in c# does the sam开发者_开发知识库e work of this code?thanks


You could use a do/while loop:

do {
    i++;
} while (x[i] < j);


Also:

do {} while (x[++i] < j);

(Purely as a stylistic alternative)

0

精彩评论

暂无评论...
验证码 换一张
取 消