//输出语句 Console.ReadLine(); //输入语句 Console.WriteLine(); /// 给函数加注解; /**/ //一段区域 // 数据类型 // 1,整型 int; // 2,浮点型 double; // 3,字符串型 string; // 4,布尔型 bool ....
Python逐行读取文件内容thefile= open("foo.txt") line = thefile.readline() while line: print line, line = thefile...
分类:
编程语言 时间:
2015-04-18 20:32:09
阅读次数:
131
while (true) { Console.Write("请输入你的楼梯数:"); int n = Convert.ToInt32(Console.ReadLine()); int fenshu = 0; if (n > 100) { Console.WriteLine("您输入的楼梯数有误!")...
分类:
其他好文 时间:
2015-04-18 12:58:19
阅读次数:
124
while (true) { Console.Write("请输入一个年份:"); int rn =Convert .ToInt32 ( Console.ReadLine()); //输入一个年份 //string s = ""; try //尝试,保护起来,使程序出错也能执行 { DateTim....
分类:
其他好文 时间:
2015-04-17 23:42:52
阅读次数:
130
while (true) { Console.Write("请输入一个时间(24小时制):"); //string s = Console.ReadLine(); int hour = Convert.ToInt32(Console .ReadLine ()); if(hour >= 0 && h....
分类:
其他好文 时间:
2015-04-16 23:27:42
阅读次数:
187
static void Main(string[] args) { ArrayList al = new ArrayList(); Console.Write("请输入人数"); int n = Convert.ToInt32(Console.ReadLine()); for (int i = 0....
分类:
其他好文 时间:
2015-04-16 11:51:03
阅读次数:
123
文本1. string:通用字符串操作2. re:正则表达式操作3. difflib:差异计算工具4. textwrap:文本填充5. unicodedata:Unicode字符数据库6. stringprep:互联网字符串准备工具7. readline:GNU按行读取接口8. rlcomplete...
分类:
编程语言 时间:
2015-04-16 01:00:50
阅读次数:
242
namespace 兔子生兔子函数递归{ class Program { static void Main(string[] args) { Console.WriteLine("请输入你想知道兔子哪个月的数量:"); int m = Convert.ToInt32(Console.ReadLine...
分类:
其他好文 时间:
2015-04-16 00:56:28
阅读次数:
188
static void Main(string[] args) { ArrayList al = new ArrayList();//集合里面所有类型都可以放入 Console.Write("请输入人数:"); int n = Convert.ToInt32(Console.ReadLine());...
分类:
其他好文 时间:
2015-04-15 19:08:41
阅读次数:
116
37.C#文件操作之文件读写前面讲了FileStream类的文件操作,现在有专门为文件读写的两个类,StreamRead和StreamWriter。1.StreamReader类。a.常用的方法。Read():用于读取输入流中的下一个字符,并使当前流的位置提升一个字符。ReadLine():用于从输入流中读取一行字符。Read..