class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                int a, b; int s = 0;
                Console.WriteLine("请输入第一个数:");
                a = Convert.ToInt32(Console.ReadLine());  //最简单的循环数,从a到b的和
                Console.WriteLine("请输入第二个数:");
                b = Convert.ToInt32(Console.ReadLine());
                for (int i = a; i <= b; i++)   //从a一直加到b
                {
                    s = s + i;
                }
                Console.WriteLine("那么从"+a+"到"+b+"的和为"+s);

Console.ReadLine();

最新文章

  1. freebsd 系统时间
  2. MVC中调用Public_Class时,VS2012老提示:当前上下文中不存在名称“Json”的解决方法
  3. spring事务管理-摘抄
  4. 格式化时间(SimpleDateFormat)
  5. OSI七层模型理解
  6. CSS的一些思考(一)
  7. python学习之路-5 基础进阶篇
  8. Cloud9vue&amp;vux上传github小步骤
  9. Python数据结构之二——tuple(元组)
  10. [HNOI 2016]大数
  11. 数位DP -启示录
  12. UGUI血条跟随
  13. 【重磅干货整理】机器学习(Machine Learning)与深度学习(Deep Learning)资料汇总
  14. 【H5】-- FormData用法介绍以及实现图片/文件上传--【XUEBIG】
  15. 使用阿里云公网ip建立bind,监听客户端连接失败
  16. Linux 之 rsyslog 系统日志转发
  17. TRIO-basic指令--九九乘法表demo
  18. VIM编码检查
  19. P1072Hankson的趣味题
  20. Node.js-Usage &amp; Example

热门文章

  1. linux yum配置
  2. C++ Union妙用(将列表初始化用于数组元素)
  3. prototype原型链继承
  4. unsigned int 转 RGB
  5. C++ 引用(&amp;)
  6. 字符串匹配算法——KMP、BM、Sunday
  7. MVC的发展
  8. JavaScript之Chart.js图例(legend)
  9. CentOS 6.4 64位 安装 jdk 6u45
  10. yaffs2文件系统