C#基础第九天-作业答案-储蓄账户(SavingAccount)和信用账户(CreditAccount)
class Bank
{
//Dictionary<long,Account> dictionary=new Dictionary<long,Account>();
DataTable table = new DataTable();//存储,储蓄账户集合
DataTable table1 = new DataTable();//存储信用账户集合
SavingAccount account = new SavingAccount();//储蓄账户类的实例化
CreditAccount account1 = new CreditAccount();//信用账户类的实例化
public void init() {
table.Columns.Add("账号");
table.Columns.Add("密码");
table.Columns.Add("真名");
table.Columns.Add("身份证");
table.Columns.Add("邮箱");
table.Columns.Add("类型");
table.Columns.Add("余额");
table.PrimaryKey = new DataColumn[] { table.Columns["账号"] };
DataRow row = table.NewRow();
row["账号"] = ;
row["密码"] = "";
row["真名"] = "小明";
row["身份证"] = "";
row["邮箱"] = "1@163";
row["类型"] = ;
row["余额"] = ;
table.Rows.Add(row);
table.Columns["类型"].DefaultValue = ;
table.Columns["余额"].DefaultValue = ; table1.Columns.Add("账号");
table1.Columns.Add("密码");
table1.Columns.Add("真名");
table1.Columns.Add("身份证");
table1.Columns.Add("邮箱");
table1.Columns.Add("类型");
table1.Columns.Add("余额");
table1.Columns.Add("额度");
table1.PrimaryKey = new DataColumn[] { table1.Columns["账号"] };
DataRow row1 = table1.NewRow();
row1["账号"] = ;
row1["密码"] = "";
row1["真名"] = "小王";
row1["身份证"] = "";
row1["邮箱"] = "2@163";
row1["类型"] = ;
row1["余额"] = ;
row1["额度"] = ;
table1.Rows.Add(row1);
table1.Columns["类型"].DefaultValue = ;
table1.Columns["余额"].DefaultValue = ;
table1.Columns["额度"].DefaultValue = ;
index();
}//初始化
public void index() { Console.WriteLine("1.开户 2.登录");
int choice=int.Parse(Console.ReadLine());
if (choice == ) {
register();
}
else if (choice == )
{ login();
}
else {
Console.WriteLine("您输入的有误,请重新输入!");
index();
}
}//主页面
public void login() {
Console.WriteLine("请选择你要登录的账户种类0.储蓄账户1.信用账户 ");
int type = int.Parse(Console.ReadLine());
if (type == ) {
Console.WriteLine("请输入用户名:");
account.Id = long.Parse(Console.ReadLine());
Console.WriteLine("请输入密码:");
account.Password = Console.ReadLine();
if (table.Rows.Contains(account.Id) && table.Rows.Find(account.Id)["密码"].ToString().Equals(account.Password))
{
Console.WriteLine("登录成功");
for (int i = ; i < table.Columns.Count; i++)
{
Console.Write(table.Columns[i] + "\t");
}
Console.WriteLine();
Console.WriteLine(table.Rows.Find(account.Id)["账号"].ToString() + "\t" + table.Rows.Find(account.Id)["密码"].ToString() + "\t" + table.Rows.Find(account.Id)["真名"].ToString() + "\t" + table.Rows.Find(account.Id)["身份证"].ToString() + "\t" + table.Rows.Find(account.Id)["邮箱"].ToString() + "\t" + table.Rows.Find(account.Id)["类型"].ToString() + "\t" + table.Rows.Find(account.Id)["余额"].ToString());
Console.WriteLine("选择您要的操作0.存款1.取款2.转账3.退出登录4.还信用卡");
int choice = int.Parse(Console.ReadLine());
if (choice == )
{
deposit(table.Rows.Find(account.Id));
}
else if (choice == )
{
withdraw(table.Rows.Find(account.Id));
}
else if (choice == )
{
transfer(table.Rows.Find(account.Id));
}
else if (choice == )
{
index();
}
else if (choice == )
{
transfer1(table.Rows.Find(account.Id));
}
}
else
{
Console.WriteLine("您的帐户名和密码有误,请重新输入");
index();
}
}
else if (type == )
{
Console.WriteLine("请输入用户名:");
account1.Id = long.Parse(Console.ReadLine());
Console.WriteLine("请输入密码:");
account1.Password = Console.ReadLine();
if (table1.Rows.Contains(account1.Id) && table1.Rows.Find(account1.Id)["密码"].ToString().Equals(account1.Password))
{
Console.WriteLine("登录成功");
for (int i = ; i < table1.Columns.Count; i++)
{
Console.Write(table1.Columns[i] + "\t");
}
Console.WriteLine();
Console.WriteLine(table1.Rows.Find(account1.Id)["账号"].ToString() + "\t" + table1.Rows.Find(account1.Id)["密码"].ToString() + "\t" + table1.Rows.Find(account1.Id)["真名"].ToString() + "\t" + table1.Rows.Find(account1.Id)["身份证"].ToString() + "\t" + table1.Rows.Find(account1.Id)["邮箱"].ToString() + "\t" + table1.Rows.Find(account1.Id)["类型"].ToString() + "\t" + table1.Rows.Find(account1.Id)["余额"].ToString() + "\t" + table1.Rows.Find(account1.Id)["额度"].ToString());
Console.WriteLine("0.存款1.取款3.退出账户");
int choice = int.Parse(Console.ReadLine());
if (choice == )
{
deposit1(table1.Rows.Find(account1.Id));
}
else if (choice == )
{
withdraw1(table1.Rows.Find(account1.Id));
}
else if (choice == )
{
index();
}
}
else
{
Console.WriteLine("您的帐户名和密码有误,请重新输入");
index();
}
} }//登录
public void register()
{
Console.WriteLine("请选择你要开户的种类0.储蓄账户1.信用账户");
int type = int.Parse(Console.ReadLine());
if (type == ) {
account.Id = table.Rows.Count + ;
Console.WriteLine("请输入密码");
account.Password = Console.ReadLine();
Console.WriteLine("请输入真名");
account.Name = Console.ReadLine();
Console.WriteLine("请输入身份证");
account.PersonId = Console.ReadLine();
Console.WriteLine("请输入邮箱");
account.Email = Console.ReadLine();
DataRow row = table.NewRow();
row["账号"] = account.Id;
row["密码"] = account.Password;
row["真名"] = account.Name;
row["身份证"] = account.PersonId;
row["邮箱"] = account.Email;
table.Rows.Add(row);
Console.WriteLine("开户成功,信息如下:");
for (int i = ; i < table.Columns.Count; i++)
{
Console.Write(table.Columns[i] + "\t");
}
Console.WriteLine();
Console.WriteLine(table.Rows.Find(account.Id)["账号"].ToString() + "\t" + table.Rows.Find(account.Id)["密码"].ToString() + "\t" + table.Rows.Find(account.Id)["真名"].ToString() + "\t" + table.Rows.Find(account.Id)["身份证"].ToString() + "\t" + table.Rows.Find(account.Id)["邮箱"].ToString() + "\t" + table.Rows.Find(account.Id)["类型"].ToString() + "\t" + table.Rows.Find(account.Id)["余额"].ToString());
Console.WriteLine("请登录");
index();
}
else if (type == )
{
account1.Id = table1.Rows.Count + ;
Console.WriteLine("请输入密码");
account1.Password = Console.ReadLine();
Console.WriteLine("请输入真名");
account1.Name = Console.ReadLine();
Console.WriteLine("请输入身份证");
account1.PersonId = Console.ReadLine();
Console.WriteLine("请输入邮箱");
account1.Email = Console.ReadLine();
DataRow row1 = table1.NewRow();
row1["账号"] = account1.Id;
row1["密码"] = account1.Password;
row1["真名"] = account1.Name;
row1["身份证"] = account1.PersonId;
row1["邮箱"] = account1.Email;
table1.Rows.Add(row1);
Console.WriteLine("开户成功,信息如下:");
for (int i = ; i < table1.Columns.Count; i++)
{
Console.Write(table1.Columns[i] + "\t");
}
Console.WriteLine();
Console.WriteLine(table1.Rows.Find(account1.Id)["账号"].ToString() + "\t" + table1.Rows.Find(account1.Id)["密码"].ToString() + "\t" + table1.Rows.Find(account1.Id)["真名"].ToString() + "\t" + table1.Rows.Find(account1.Id)["身份证"].ToString() + "\t" + table1.Rows.Find(account1.Id)["邮箱"].ToString() + "\t" + table1.Rows.Find(account1.Id)["类型"].ToString() + "\t" + table1.Rows.Find(account1.Id)["余额"].ToString() + "\t" + table1.Rows.Find(account1.Id)["额度"].ToString());
Console.WriteLine("请登录");
index();
}
}//注册
public void deposit(DataRow dr) {
if (dr != null)
{
Console.WriteLine("请输入你要存入的金额:");
double money = double.Parse(Console.ReadLine());
dr["余额"] = Convert.ToDouble((dr["余额"])) + money;
for (int i = ; i < table.Columns.Count; i++)
{
Console.Write(table.Columns[i] + "\t");
}
Console.WriteLine();
Console.WriteLine(table.Rows.Find(account.Id)["账号"].ToString() + "\t" + table.Rows.Find(account.Id)["密码"].ToString() + "\t" + table.Rows.Find(account.Id)["真名"].ToString() + "\t" + table.Rows.Find(account.Id)["身份证"].ToString() + "\t" + table.Rows.Find(account.Id)["邮箱"].ToString() + "\t" + table.Rows.Find(account.Id)["类型"].ToString() + "\t" + table.Rows.Find(account.Id)["余额"].ToString());
Console.WriteLine("选择您要的操作0.存款1.取款2.转账3.退出登录4.还信用卡");
int choice = int.Parse(Console.ReadLine());
if (choice == )
{
deposit(table.Rows.Find(account.Id));
}
else if (choice == )
{
withdraw(table.Rows.Find(account.Id));
}
else if (choice == )
{
transfer(table.Rows.Find(account.Id));
}
else if (choice == )
{
index();
}
else if (choice == )
{
transfer1(table.Rows.Find(account.Id));
}
}
else {
Console.WriteLine("您还没有登录");
login();
}
}//储蓄账户存款
public void deposit1(DataRow dr)
{
if (dr != null)
{
Console.WriteLine("请输入你要存入的金额:");
double money = double.Parse(Console.ReadLine());
dr["余额"] = Convert.ToDouble((dr["余额"])) + money;
for (int i = ; i < table1.Columns.Count; i++)
{
Console.Write(table1.Columns[i] + "\t");
}
Console.WriteLine();
Console.WriteLine(table1.Rows.Find(account1.Id)["账号"].ToString() + "\t" + table1.Rows.Find(account1.Id)["密码"].ToString() + "\t" + table1.Rows.Find(account1.Id)["真名"].ToString() + "\t" + table1.Rows.Find(account1.Id)["身份证"].ToString() + "\t" + table1.Rows.Find(account1.Id)["邮箱"].ToString() + "\t" + table1.Rows.Find(account1.Id)["类型"].ToString() + "\t" + table1.Rows.Find(account1.Id)["余额"].ToString() + "\t" + table1.Rows.Find(account1.Id)["额度"].ToString());
Console.WriteLine("选择您要的操作0.存款1.取款3.退出登录");
int choice = int.Parse(Console.ReadLine());
if (choice == )
{
deposit1(table1.Rows.Find(account1.Id));
}
else if (choice == )
{
withdraw1(table1.Rows.Find(account1.Id));
}
else if (choice == )
{
index();
}
}
else
{
Console.WriteLine("您还没有登录");
login();
}
}//信用账户存款
public void withdraw(DataRow dr)
{
if (dr != null)
{
Console.WriteLine("请输入你要取出的金额:");
double money = double.Parse(Console.ReadLine());
if (Convert.ToDouble((dr["余额"])) >= money)
{
dr["余额"] = Convert.ToDouble((dr["余额"])) - money;
for (int i = ; i < table.Columns.Count; i++)
{
Console.Write(table.Columns[i] + "\t");
}
Console.WriteLine();
Console.WriteLine(table.Rows.Find(account.Id)["账号"].ToString() + "\t" + table.Rows.Find(account.Id)["密码"].ToString() + "\t" + table.Rows.Find(account.Id)["真名"].ToString() + "\t" + table.Rows.Find(account.Id)["身份证"].ToString() + "\t" + table.Rows.Find(account.Id)["邮箱"].ToString() + "\t" + table.Rows.Find(account.Id)["类型"].ToString() + "\t" + table.Rows.Find(account.Id)["余额"].ToString());
Console.WriteLine("选择您要的操作0.存款1.取款2.转账3.退出登录4.还信用卡");
int choice = int.Parse(Console.ReadLine());
if (choice == )
{
deposit(table.Rows.Find(account.Id));
}
else if (choice == )
{
withdraw(table.Rows.Find(account.Id));
}
else if (choice == )
{
transfer(table.Rows.Find(account.Id));
}
else if (choice == )
{
index();
}
else if (choice == )
{
transfer1(table.Rows.Find(account.Id));
}
}
else {
Console.WriteLine("您的余额不足!");
withdraw(table.Rows.Find(account.Id));
}
}
else
{
Console.WriteLine("您还没有登录");
login();
}
}//储蓄账户取款
public void withdraw1(DataRow dr)
{
if (dr != null)
{
Console.WriteLine("请输入你要取出的金额:");
double money = double.Parse(Console.ReadLine());
if (Convert.ToDouble((dr["余额"])) >= money)
{
dr["余额"] = Convert.ToDouble((dr["余额"])) - money;
for (int i = ; i < table1.Columns.Count; i++)
{
Console.Write(table1.Columns[i] + "\t");
}
Console.WriteLine();
Console.WriteLine(table1.Rows.Find(account1.Id)["账号"].ToString() + "\t" + table1.Rows.Find(account1.Id)["密码"].ToString() + "\t" + table1.Rows.Find(account1.Id)["真名"].ToString() + "\t" + table1.Rows.Find(account1.Id)["身份证"].ToString() + "\t" + table1.Rows.Find(account1.Id)["邮箱"].ToString() + "\t" + table1.Rows.Find(account1.Id)["类型"].ToString() + "\t" + table1.Rows.Find(account1.Id)["余额"].ToString() + "\t"+table1.Rows.Find(account1.Id)["额度"].ToString());
Console.WriteLine("选择您要的操作0.存款1.取款3.退出登录");
int choice = int.Parse(Console.ReadLine());
if (choice == )
{
deposit1(table1.Rows.Find(account1.Id));
}
else if (choice == )
{
withdraw1(table1.Rows.Find(account1.Id));
}
else if (choice == )
{
index();
}
}
else if (Convert.ToDouble((dr["余额"])) < money && Convert.ToDouble((dr["余额"])) + Convert.ToDouble((dr["额度"])) >= money) {
dr["余额"] = Convert.ToDouble((dr["余额"])) - money;
for (int i = ; i < table1.Columns.Count; i++)
{
Console.Write(table1.Columns[i] + "\t");
}
Console.WriteLine();
Console.WriteLine(table1.Rows.Find(account1.Id)["账号"].ToString() + "\t" + table1.Rows.Find(account1.Id)["密码"].ToString() + "\t" + table1.Rows.Find(account1.Id)["真名"].ToString() + "\t" + table1.Rows.Find(account1.Id)["身份证"].ToString() + "\t" + table1.Rows.Find(account1.Id)["邮箱"].ToString() + "\t" + table1.Rows.Find(account1.Id)["类型"].ToString() + "\t" + table1.Rows.Find(account1.Id)["余额"].ToString() +"\t"+ table1.Rows.Find(account1.Id)["额度"].ToString());
Console.WriteLine("选择您要的操作0.存款1.取款2.转账3.退出登录");
int choice = int.Parse(Console.ReadLine());
if (choice == )
{
deposit1(table1.Rows.Find(account.Id));
}
else if (choice == )
{
withdraw1(table1.Rows.Find(account1.Id));
}
else if (choice == )
{
withdraw1(table.Rows.Find(account.Id));
}
else if (choice == )
{
index();
} }
else
{
Console.WriteLine("您的余额和额度不够!");
withdraw1(table1.Rows.Find(account1.Id));
}
}
else
{
Console.WriteLine("您还没有登录");
login();
}
}//信用账户取款
public void transfer(DataRow dr) {
Console.WriteLine("请输入你要转账的金额");
double money = double.Parse(Console.ReadLine());
if (Convert.ToDouble((dr["余额"])) >= money)
{
Console.WriteLine("请输入对方账号");
long toId = long.Parse(Console.ReadLine());
dr["余额"] = Convert.ToDouble((dr["余额"])) - money;
for (int i = ; i < table.Columns.Count; i++)
{
Console.Write(table.Columns[i] + "\t");
}
Console.WriteLine();
Console.WriteLine(table.Rows.Find(account.Id)["账号"].ToString() + "\t" + table.Rows.Find(account.Id)["密码"].ToString() + "\t" + table.Rows.Find(account.Id)["真名"].ToString() + "\t" + table.Rows.Find(account.Id)["身份证"].ToString() + "\t" + table.Rows.Find(account.Id)["邮箱"].ToString() + "\t" + table.Rows.Find(account.Id)["类型"].ToString() + "\t" + table.Rows.Find(account.Id)["余额"].ToString()); table.Rows.Find(toId)["余额"] = double.Parse(table.Rows.Find(toId)["余额"].ToString()) + money; Console.WriteLine("选择您要的操作0.存款1.取款2.转账3.退出登录");
int choice = int.Parse(Console.ReadLine());
if (choice == )
{
deposit(table.Rows.Find(account.Id));
}
else if (choice == )
{
withdraw(table.Rows.Find(account.Id));
}
else if (choice == )
{
transfer(table.Rows.Find(account.Id));
}
else if (choice == )
{
index();
}
}
else { }
}//储蓄账户之间转账
public void transfer1(DataRow dr)
{
Console.WriteLine("请输入你要转账的金额");
double money = double.Parse(Console.ReadLine());
if (Convert.ToDouble((dr["余额"])) >= money)
{
Console.WriteLine("请输入信用卡账号");
long toId = long.Parse(Console.ReadLine());
dr["余额"] = Convert.ToDouble((dr["余额"])) - money;
for (int i = ; i < table.Columns.Count; i++)
{
Console.Write(table.Columns[i] + "\t");
}
Console.WriteLine();
Console.WriteLine(table.Rows.Find(account.Id)["账号"].ToString() + "\t" + table.Rows.Find(account.Id)["密码"].ToString() + "\t" + table.Rows.Find(account.Id)["真名"].ToString() + "\t" + table.Rows.Find(account.Id)["身份证"].ToString() + "\t" + table.Rows.Find(account.Id)["邮箱"].ToString() + "\t" + table.Rows.Find(account.Id)["类型"].ToString() + "\t" + table.Rows.Find(account.Id)["余额"].ToString()); table1.Rows.Find(toId)["余额"] = double.Parse(table1.Rows.Find(toId)["余额"].ToString()) + money; Console.WriteLine("选择您要的操作0.存款1.取款2.转账3.退出登录4.还信用卡");
int choice = int.Parse(Console.ReadLine());
if (choice == )
{
deposit(table.Rows.Find(account.Id));
}
else if (choice == )
{
withdraw(table.Rows.Find(account.Id));
}
else if (choice == )
{
transfer(table.Rows.Find(account.Id));
}
else if (choice == )
{
index();
}
else if (choice == )
{
transfer1(table.Rows.Find(account.Id));
}
}
else
{ }
}//还信用卡 }
本系列教程:
C#基础总结之八面向对象知识点总结-继承与多态-接口-http://www.cnblogs.com/spring_wang/p/6113531.html
C#基础总结之七面向对象知识点总结1http://www.cnblogs.com/spring_wang/p/6113526.html
C#基础总结之六 DataTable (临时表/数据源) 和Datatable 名片练习http://www.cnblogs.com/spring_wang/p/6113520.html
C#基础总结之五Dictionary<string, string[]>和while循环http://www.cnblogs.com/spring_wang/p/6113514.html
C#基础总结之四List-Hashtable-冒泡排序http://www.cnblogs.com/spring_wang/p/6113504.html
C#基础总结之三循环控制-for-数组-乘法表-arraylisthttp://www.cnblogs.com/spring_wang/p/6113496.html
C#基础总结之二循环控制-运算符http://www.cnblogs.com/spring_wang/p/6113484.html
C#基础总结之一变量常量-if嵌套语句-witch结构-类型转换http://www.cnblogs.com/spring_wang/p/6113476.html
C#基础课程之六(临时表)DataTable使用方法http://www.cnblogs.com/spring_wang/p/6113454.html
C#基础课程之五集合(HashTable,Dictionary)http://www.cnblogs.com/spring_wang/p/6113404.html
C#基础课程之四集合(ArrayList、List<泛型>)http://www.cnblogs.com/spring_wang/p/6113396.html
C#基础课程之三循环语句http://www.cnblogs.com/spring_wang/p/6113383.html
C#基础课程之二变量常量及流程控制http://www.cnblogs.com/spring_wang/p/6113372.html
C#基础课程之一注释和控制台、一些常识http://www.cnblogs.com/spring_wang/p/6113361.html
C#基础第九天-作业答案-储蓄账户(SavingAccount)和信用账户(CreditAccount) http://www.cnblogs.com/spring_wang/p/6113291.html
C#基础第九天-作业-储蓄账户(SavingAccount)和信用账户(CreditAccount) http://www.cnblogs.com/spring_wang/p/6113285.html
C#基础第八天-作业答案-设计类-面向对象方式实现两个帐户之间转账http://www.cnblogs.com/spring_wang/p/6113274.html
C#基础第八天-作业-设计类-面向对象方式实现两个帐户之间转账http://www.cnblogs.com/spring_wang/p/6113258.html
C#基础第七天-作业答案-利用面向对象的思想去实现名片-动态添加http://www.cnblogs.com/spring_wang/p/6113232.html
C#基础第七天-作业-利用面向对象的思想去实现名片-动态添加http://www.cnblogs.com/spring_wang/p/6113224.html
C#基础第六天-作业-利用面向对象的思想去实现名片http://www.cnblogs.com/spring_wang/p/6113028.html
C#基础第六天-作业答案-利用面向对象的思想去实现名片http://www.cnblogs.com/spring_wang/p/6113033.html
C#基础第五天-作业答案-用DataTable制作名片集http://www.cnblogs.com/spring_wang/p/6113022.html
C#基础第五天-作业-用DataTable制作名片集http://www.cnblogs.com/spring_wang/p/6113013.html
C#基础第四天-作业答案-Hashtable-list<KeyValuePair>泛型实现名片http://www.cnblogs.com/spring_wang/p/6113005.html
C#基础第四天-作业-Hashtable-list<KeyValuePair>泛型实现名片http://www.cnblogs.com/spring_wang/p/6113000.html
C#基础第三天-作业答案-集合-冒泡排序-模拟名片http://www.cnblogs.com/spring_wang/p/6112888.html
C#基础第三天-作业-集合-冒泡排序-模拟名片http://www.cnblogs.com/spring_wang/p/6112885.html
C#基础第二天-作业答案-九九乘法表-打印星星http://www.cnblogs.com/spring_wang/p/6112881.html
C#基础第二天-作业-九九乘法表-打印星星http://www.cnblogs.com/spring_wang/p/6112875.html
C#基础第一天-作业答案http://www.cnblogs.com/spring_wang/p/6112872.html
C#基础第一天-作业http://www.cnblogs.com/spring_wang/p/6112867.html
C#-string.Format对C#字符串格式化http://www.cnblogs.com/spring_wang/p/6077098.html
C#基础第九天-作业答案-储蓄账户(SavingAccount)和信用账户(CreditAccount)的更多相关文章
- C#基础第九天-作业-储蓄账户(SavingAccount)和信用账户(CreditAccount)
要求1:完成以下两种账户类型的编码.银行的客户分为两大类:储蓄账户(SavingAccount)和信用账户(CreditAccount),两种的账户类型的区别在于:储蓄账户不允许透支,而信用账户可以透 ...
- C#基础第八天-作业答案-设计类-面向对象方式实现两个帐户之间转账
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- C#基础第二天-作业答案-九九乘法表-打印星星
题一:九九乘法表的答案 //正三角 ; i < ; i++) { ; j <= i; j++) { Console.Write("{0}*{1}={2} ", j, i ...
- C#基础第一天-作业答案
题一答案: Console.WriteLine("请输入a"); int a = Convert.ToInt32(Console.ReadLine()); Console.Writ ...
- C#基础第七天-作业答案-利用面向对象的思想去实现名片-动态添加
class Card { private string name; public string Name { get { return name; } set { name = value; } } ...
- C#基础第六天-作业答案-利用面向对象的思想去实现名片
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- C#基础第五天-作业答案-用DataTable制作名片集
.DataTable 实现 DataTable PersonCard = new DataTable(); //创建一个DataTable DataTable PersonCardCopy = new ...
- C#基础第四天-作业答案-Hashtable-list<KeyValuePair>泛型实现名片
.Hashtable 实现 Hashtable table = new Hashtable(); while (true) { Console.WriteLine("------------ ...
- C#基础第三天-作业答案-集合-冒泡排序-模拟名片
.冒泡排序 Console.WriteLine("对集合里的数进行排序,请输入第一个数:"); int a = int.Parse(Console.ReadLine()); Con ...
随机推荐
- Sqlite执行insert or ignore 或insert or replace语句。
Sqlite执行insert or ignore 或insert or replace语句. ,); ,); 上面的第一条语句是每次执行时,如果不存在,则添加,如果存在,则更新. 上面的第二条语句是每 ...
- 1050: 贝贝的ISBN号码(isbn)
#include <iostream> #include <iomanip> #include <cstdlib> #include <string> ...
- j2ee数据库连接池配置大全
<!--web.xml begin--> <!--web.xml Spring ApplicationContext配置文件的路径 ,可使用通配符,多个路径用,号分隔 --> ...
- JAVA各种泛型事例总结
转自:http://www.cnblogs.com/sunwei2012/archive/2010/10/08/1845938.html 普通泛型 class Point<T>{ // 此 ...
- 延迟加载-association来实现
resultMap可以实现高级映射(使用association.collection实现一对一及一对多映射),association.collection具备延迟加载功能. 需求: 如果查询订单并且关 ...
- C语言中连接器介绍
在C语言中.一个重要的思想就是分别编译.即若干个源程序能够在不同的时候单独进行编译.然后在恰当的时候整合到一起.可是连接器通常是与C编译器分离的,连接器怎样做到把若干个C源程序合并成一个总体呢? 典型 ...
- cmake常用编译选项
1.openmp加载,cmake3.9之后内置了openmp find_package(OpenMP) if (OPENMP_FOUND OR OpenMP_CXX_FOUND) set (CMAKE ...
- 【DB2】数据库的事务日志已满。SQLSTATE=57011
问题描述 在使用数据库的时候报错如上图,我们先使用db2 get db cfg for sample查看相关配置参数,其中sample为数据库名称 C:\Users\Thinkpad>db2 g ...
- python之函数用法islower()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法islower() #http://www.runoob.com/python/att ...
- N皇后问题【递归求解】
n皇后问题:输入整数n, 要求n个国际象棋的皇后,摆在n*n的棋盘上,互相不能攻击,输出全部方案. 输入一个正整数N,则程序输出N皇后问题的全部摆法.输出结果里的每一行都代表一种摆法.行里的第i个数字 ...