C#中用while和do,while循环语句计算1-100的奇数和偶数和的代码怎么写
题目
C#中用while和do,while循环语句计算1-100的奇数和偶数和的代码怎么写
答案
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("使用While结构计算");
int oddSum = 0,evenSum=0,i = 1;
while (i
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
最新试题
- 一竖两横 一横两竖 是什么字
- 大学里的物理题目 in english!
- 把体积是1dm的立方的铁球(铁的密度7.8*10的三次方)挂在弹簧称上,若将铁球浸没在水中,则弹簧称的示数是它在空气中称时的五分之四.求(1)铁球受到的浮力.(2)铁球受到的重力.(3)这个铁球是空心
- 一张扑克牌有52张,不放回抽样,每次一张,连续抽取4张,计算四张中只有两种花色的概率.
- 像霍金一样身残志坚车的杰出成就的人还有谁
- 作文 XX的XX 300字左右 要有细节描写
- 两个相同的容器,一个盛氦气,一个盛氢气,它们压强和温度都相等,现将5J的热量传给氢气,使氢气温度升高,如使氦气也升高相同的温度,则应向氦气传递热量多少?
- 叶相判案的翻译素什么.
- 三相电表上的数字显示框内,读数的最后一位算步算
- 二元一次方程5x+2y=25的正整数解是
热门考点