C#趣味程序---个位数为6,且能被3整出的五位数
2015-12-27 15:49
288 查看
using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int count = 0; int k; for (int i = 1000; i < 9999; i++) { k = i * 10 + 6; if (k % 3== 0) { Console.WriteLine(k); count++; } } Console.WriteLine(count); } } }
相关文章推荐
- C#实现的自定义邮件发送类完整实例(支持多人多附件)
- C#中的遍历
- 哈希表,HashTable
- C#中的internal关键字
- C#使用StreamWriter类写入文件文件
- C# Console.WriteLine()函数中{}输出格式详解
- C#学习笔记006-字符串
- C#编程中Console.Write()和Console.WriteLine()的区别
- C# Color转化问题
- 基于C#实现12306的动态验证码变成静态验证码的方法
- C#_List<T>升序排序和降序排序
- C#英汉翻译
- 用C#实现通用的DAL Insert
- c#中调用DLL
- Protobuf C#教程 ThriftC#教程大合辑
- C#之try-catch
- 【C#】 多态
- C#_List<T>的使用
- C# 中如何将一个类文件(XX.CS)封装成.dll文件
- c# 委托和事件(总结篇)