200之内被7整除的数
2015-08-05 20:37
260 查看
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication58 { class Program { static void Main(string[] args) { int n, m = 0; try { do { Console.Write("输入一个7~200之间的任意数字"); n = int.Parse(Console.ReadLine()); } while (n < 7 || n > 200); Console.WriteLine("范围内能被7整除的数依次为"); for (int i = 7; i <= n; i++) { if (i % 7 == 0 ) { Console.Write( i + ""); m++; } } } catch { Console.WriteLine("输入有误"); } if (m == 0) Console.Write("范围内没有被7整除的数"); Console.Write("\n范围内被7整除的个数为" +m); Console.ReadLine(); } } }
相关文章推荐
- iOS之UIView的变更动画
- c#构造函数
- vim中的airline插件不显示箭头(解决)
- 虚拟化项目之运维实践
- 关于QT的系统总结
- JavaScript基础----09Javascript语法-循环语句while循环
- VS2010的MFC对话框程序中添加菜单栏的过程
- 随便写写
- 搜索引擎收录大全
- DayuCMS 1.525 /include/global.func.php Foreground Arbitrary Code Execution
- TypeError: 'range' object doesn't support item deletion
- 2717 Catch That Cow【bfs】
- Linux tr 命令
- Android之framework修改底部导航栏NavigationBar动态显示和隐藏
- JavaScript基础----08Javascript语法-循环语句for循环
- POJ 1873 The Fortified Forest(凸包+枚举 World Finals 1999啊)
- 关于Oracle创建表空间和用户
- 28.UIScrollView和UIPageController
- HR-资产管理
- java文件操作工具类