hhjc.net
当前位置:首页 >> C#whilE输出1到100 >>

C#whilE输出1到100

int i=1;while(i{ console.write(i); i++; }

int num=1; int sum=0; do { sum += num; num++; } while (num < 101); Console.WriteLine(sum); Console.Read();

do语句; while条件------------- class whilestate1 { static void Main() { int i = 1; int sum = 0; do { sum += i; i++; if(i>100); } while (true) 括号那个格式自己排 ,我这只是大致意思(手头没编译器),但绝对正确!!------------------- nandaowo说的不是c#

int sum=0;for (int i=1; i<=100; i++) if (i % 2==0 || i % 3 ==0) sum+=i;WriteLine(" sum = {0} ", sum);

int i=1,sum=0; do { sum+=i; i++; } while(i 评论0 0 0

int num = 1;while(num 评论0 0 0

int a = 1; while (a <= 100) { a++; if (a % 2 != 0) { continue; } Console.WriteLine (a);

static void Main(string[] args) { int num = 0; for (int i = 1; i <= 100; i++) { num++; } Console.WriteLine(num.ToString());}

#include int main(){ int i=1; while(i printf("%d\n",i++); } return 0; }

main(){ int i,sum; i=1; sum=0; while(i 评论0 0 0

ncry.net | jingxinwu.net | zxtw.net | qhgj.net | ntxp.net | 网站首页 | 网站地图
All rights reserved Powered by www.hhjc.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com