- 博客(18)
- 收藏
- 关注
原创 在PowerDesigner 软件中创建数据库模型
File----New Model -----Physical Data Model(PDM 物理数据模型)------TableTable: Name---可中文可英文Code----必须英文Comment----注释Data Type----数据类型Length----长度I----自增P----主键F----外键M----强制性非空设置属性默认值:选中...
2018-07-24 15:02:34
452
原创 C#异常处理 try、catch、finally
1.当除以0,抛出异常namespace ClassTest{ class Program { int result; Program() { result=0; } public void division(int num1,int num2) { ...
2018-03-29 11:33:47
273
原创 C#连接Sql Server数据库并显示在控制台上
1、使用SQL用户名、密码验证 Data Source = 服务器名;Initial Catalog = 数据库名;User ID = 用户名;Pwd = 密码(没有密码可以省略) 例如:public string connString = "Data Source=xp;Initial Catalog=student;User ID = 123;Pw...
2018-03-14 15:37:47
5316
1
原创 C#值类型与引用类型
数据类型分为:值类型、引用类型值类型:int、char、double、bool、结构(struct)、枚举(enum)。。。 (存储在堆栈中) 引用类型:类(string。。)、数组、接口 (存储在托管堆中) 2. 值类型:变量存储对象的值,赋值会创建值的副本,修改任何一个副本,不会影响其他的 副本; int x = 5; in...
2018-03-14 09:54:21
193
原创 C#中使用Char类中的方法对字符进行各种操作,判断是否为字母、数字、标点符号、分隔符或空白。
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace text{ class Program { static void Main(string[] args) ...
2018-03-09 16:19:57
5466
1
原创 C++文本文件的读写
//生成一个table.txt文件,保存到D盘//文件内容为100以内整数的平方根表,结果精确到小数点后4位#include#include#include using namespace std;int main(){ //ofstream 需要头文件,打开一个输出文件 ofstream table; table.open("D://table.txt"); int
2017-06-22 16:21:01
322
原创 复制构造函数被调用的三种情况
/*复制构造函数被调用的三种情况:1.当用类的一个对象去初始化该类的另一个对象时2.如果函数的形参是类的对象,调用函数时,进行形参和实参结合时3.如果函数的返回值是类的对象,函数执行完成返回调用者时*/#includeusing namespace std;class Point{public: Point(int xx = 0, int yy = 0){ //构造函数
2017-06-04 21:24:20
917
原创 c++的最基础的类和对象
#includeusing namespace std;class Clock{public: void setTime(int newH=0, int newM=0, int newS=0); void showTime();private: int hour, minute, second;};void Clock::setTime(int newH, int newM,
2017-06-04 20:56:40
274
原创 链队列的初始化、出队、入队、取队头元素、判空
#include#includeusing namespace std;typedef struct qnode{ int data; struct qnode *next;}LQNode;typedef struct{ LQNode *front; //队头 LQNode *rear; //队尾}LQueue;void QueueInitiate(LQueu
2017-04-08 16:04:40
8442
原创 顺序循环队列 初始化、出队、入队、取队头元素、判空
#include //顺序循环队列 对尾插入,对头删除,先进先出#define MaxSize 20typedef struct{ int queue[MaxSize]; int rear; //对尾指针 int front; //对头指针 int count; //计数器}SeqCQueue;void QueueInitiate(SeqCQueue *
2017-04-08 15:17:50
9319
原创 用C语言编写杨辉三角形
#includeint main(){ int a[20][20]; int i,j,t,k; for(i=0;i<20;++i) { for(j=0;j<20;j++) a[i][j] = 0; } printf("请输入杨辉三角形所需行数:"); scanf_s("%d",&t); for(i=0;i<t;++i) { for(k=t;k>i;k--
2017-03-31 18:10:30
2890
原创 顺序堆栈的操作实现
#include#define MaxStackSize 100typedef int DataType;typedef struct //定义结构体{ DataType stack[MaxStackSize]; int top;}SeqStack;void InitStack(SeqStack *s) //初始化{ s->top = 0;}int StackN
2017-03-28 20:04:32
580
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人