体验C#
八六上山啦
步步前进,日日不止
展开
-
体验C#——关于一些循环语句
简单写了个C#关于循环语句测试的程序:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace XunhuanTest{ //for语句 class ForStatement { public void forTest()原创 2014-12-02 10:15:42 · 1430 阅读 · 0 评论 -
体验C#——试试泛型集合
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections.Generic;namespace UseFanxing{ class Student { private int age;原创 2014-12-10 11:11:26 · 1224 阅读 · 0 评论 -
体验C#——用几个小题看一下“集合”
一、随机将若干枚一角,5角,一元的硬币放在一个狭小的黑丝管道里,现要取出一枚5角的硬币使用,求首次取出5角硬币所用的次数。(用Stack类)using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace Stack原创 2014-12-09 11:04:45 · 1238 阅读 · 1 评论 -
体验C#——重温运算符【转】
C# 运算符运算符是一种告诉编译器执行特定的数学或逻辑操作的符号。C# 有丰富的内置运算符,分类如下:算术运算符关系运算符逻辑运算符位运算符赋值运算符杂项运算符本教程将逐一讲解算术运算符、关系运算符、逻辑运算符、位运算符、赋值运算符及其他运算符。算术运算符下表显示了 C# 支持的所有算术运算符。假设变量 A 的值为 10,变量 B 的值为 20,则:转载 2014-12-08 09:54:07 · 1279 阅读 · 0 评论 -
体验C#——冒泡算法的C#实现
一、冒泡排序的基本流程。 二、C#代码实现using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace T2Array{ class Sort {原创 2014-12-04 11:13:50 · 1886 阅读 · 0 评论 -
体验C#——关于数组合并的简单算法的实现
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace T3Array{ class Program { //合并为一维数组 static int[] MergeOne(int[] a,int[] b)原创 2014-12-04 11:18:03 · 2253 阅读 · 6 评论 -
体验C#——Array类的使用
using System;using System.Collections.Generic;using System.Linq;using System.Text;//using System.Array;namespace UseArray{ //建立一维数组保存学生信息 class StudentGrade { private Array原创 2014-12-04 10:17:32 · 2183 阅读 · 0 评论 -
体验C#——使用数组
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ArrayTest{ class One_dimensional_array { public void test() { stri原创 2014-12-03 10:13:15 · 1091 阅读 · 0 评论 -
体验C#——继承
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ElectricDemo{ public class Electric { private int power; private int R_voltage原创 2014-12-18 10:31:31 · 842 阅读 · 0 评论 -
体验C#——关于循环语句的一些有趣题目的实现
一、设计一个简单的猜数游戏:随机产生一个1-100的数,要求输入的数与随机产生的数进行比较,如果输入的数大于随机产生的数,提示:“对不起,您猜大了!”;如果输入的数小于随机产生的数,提示:“对不起,您猜小了!”;如果输入的数等于随机产生的数,提示:“恭喜您,您猜对了!”程序结束。提示:随机产生一个1-100的整数的方法 Random rnd = ne原创 2014-12-02 11:54:36 · 2263 阅读 · 0 评论 -
体验C#——聊聊方法的那些参数
一、代码using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ShowParams{ class Program { //看看C#中方法的参数的区别 //1、值参数 会把内存中的某变量的值copy一份,原创 2014-12-16 11:17:28 · 1063 阅读 · 0 评论