常见算法C#描述
冒泡排序
using System;
class Program
{
public static void Main()
{
int[] a = new int[10];
Random rand = new Random();
for (int i = 0; i < 10; i++)
{
a[i] = rand.Next(10);//生成随机数给数组赋值
}
for (int i = 0; i < 10; i++)
{
Console.Write(a[i]);
}
for(int i=0;i<9;i++)
for (int j = i + 1; j < 10; j++)
{
int temp = 0;
if (a[i] > a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
Console.WriteLine();
for (int i = 0; i < 10; i++)
Console.Write(a[i]);
Console.Read();
}
}
相关文档:
接上一篇
显示所有结点的内容
1 原xml文件 bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book ISBN="1234123">
<title>who am i </title>
<author>who</author>
<price> ......
1、C/C++程序员请注意,不能在case语句不为空时“向下执行”。
2、值类型和引用类型之间的区别:C#的基本类型(int,char等)都是值类型,是在栈中创建的。而对象是引用类型,创建于堆中,需要使用关键字new。
3、在C#中通过实例访问静态方法或成员变量是不合法的,会生成编译器错误。但是我们可以通过声明他 ......
记取记录集
create procedure getArticle
as
select * from Article_Content
GO
asp.net 调用方法
SqlConnection Conn = new SqlConnection();
Conn.ConnectionString = Data.Connstr();
Conn.Open();
......
C-#入门经典(第三版).pdf
using System;
using System.Data;
using System.Data.SqlClient;
namespace My_Student
{
static class Program
{
static void Main()
&n ......
1 JavaScript发送邮件
<script language="javascript">
function SendMail() {
document.location = "mailto:seat@wicresoft.com;?subject=Feedback";
&n ......