c#while循环怎么实现打一组数字加上上一组数据 - 爱问答

(爱问答)

c#while循环怎么实现打一组数字加上上一组数据

各位大神  我现在遇到的问题是  在控制台应用程序中,实现x=任意输入值加上之前的X啊

using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace 中断循环{    class Program    {        static void Main(string[] args)        {            //100以内符合i%7==0 || i%10==7||i/10==7条件的,统计次数一次            int i = 0;            int number=0;            while (i < 100)            {                i++;                if(i%7==0 || i%10==7||i/10==7)                {                number++;                System.Threading.Thread.Sleep(1000);  // 让程序休眠一秒                 continue;                }                Console.WriteLine("{0}",i);                Console.WriteLine(number);                        }            Console.ReadKey();        }    }}while中return,continue,break的区别。return:退出main函数continue:直接进行下轮循环break:直接跳出当前循环

下一篇:如何修改mdb文件

上一篇:c语言编程显示汉字科海无边然后通过上下箭头键实现缩放功能的程序!大佬们求助在线等

热门标签:
excel 网盘 破解 word dll
最新更新:
微软重新评估新的Outlook的使用时机 联想推出搭载联发科Helio G80芯片组的Tab M9平板 英特尔创新大赛时间确定! 微软Edge浏览器在稳定渠道中推出Workspaces功能 英伟达RTX4060TiGPU推出MaxSun动漫主题! 谷歌地图为用户提供了街景服务! GameSir 在T4 Kaleid中推出了一款出色的控制器! 微软开始在Windows 11 中测试其画图应用程序的新深色模式! LG电子推出全球首款无线OLED电视 英伟达人工智能芯片崭露头角! Steam Deck可以玩什么游戏-Steam Deck价格限时优惠 雷蛇推出CobraPro鼠标 Kindle电子阅读器可以访问谷歌商店吗 Windows10如何加入组策略 window10图片查看器怎么没有了?