摘要: 1.输入姓名直到输入的是quit时(不区分大小写),停止输入然后显示出输入的姓名个数及姓名: 要求结果如下图所示: 1 class Program 2 { 3 static void Main(string[] args) 4 { 5 //集合存放输入的姓名 6 List<string> listN 阅读全文
posted @ 2014-02-17 18:28 土豆哥 阅读(1053) 评论(2) 推荐(0)
摘要: 字符串去掉两端空格,并且将字符串中多个空格替换成一个空格: 主要还是考察使用字符串的方法: trim(); 去掉字符串两端空格 split(); 切割 string.join(); 连接 1 class Program 2 { 3 static void Main(string[] args) 4 阅读全文
posted @ 2014-02-17 17:46 土豆哥 阅读(892) 评论(2) 推荐(0)
摘要: 字符串中某个词出现的次数主要是考察队字符串方法的使用: indexof(): 有9个重载,具体的请转到F12查看详细内容; 本文使用的是第6个重载: 如果找到该字符串,则为从零开始的索引位置;如果未找到该字符串,则为 -1 有两个参数: string value: 要搜索的字符 int startI 阅读全文
posted @ 2014-02-17 12:00 土豆哥 阅读(2742) 评论(0) 推荐(1)
摘要: 冒泡排序口诀: 升序(从小到大): 两for一if; 大于连; 相 交换; 再来个for遍历; 外层N-1; 内层N-1-i; 说再多不如上代码,更明显: 1 class Program 2 { 3 static void Main(string[] args) 4 { 5 int[] array 阅读全文
posted @ 2014-02-17 11:07 土豆哥 阅读(793) 评论(0) 推荐(0)
摘要: 一个整型数组的平均: 1 class Program 2 { 3 static void Main(string[] args) 4 { 5 int[] array = {1,2,3,4,5,6,7,8,9,10}; 6 double avg= GetAvg(array); 7 Console.Wr 阅读全文
posted @ 2014-02-17 10:02 土豆哥 阅读(824) 评论(0) 推荐(0)
摘要: sqlServer 基础知识 大纲 备份数据库: 还原数据库: USE [master] GO /****** Object: StoredProcedure [dbo].[RestoreDB] Script Date: 01/18/2018 12:13:53 ******/ SET ANSI_NU 阅读全文
posted @ 2014-02-17 09:22 土豆哥 阅读(675) 评论(0) 推荐(0)
摘要: 求字符串数组中最大长度的字符串: 实质就是比较字符串的长度; 方案一: 1 class Program 2 { 3 static void Main(string[] args) 4 { 5 string[] array = {"张三","亲,今天购物了么!","明天你喜欢很久的人要结婚了,你怎么办 阅读全文
posted @ 2014-02-17 00:18 土豆哥 阅读(2531) 评论(3) 推荐(0)