自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(280)
  • 收藏
  • 关注

原创 C#实战项目1 Windows计算器的制作

文章目录系统功能描述具体实现系统功能描述Windows计算器是利用C#程序编写一个简易计算器程序,可以进行简单的加减乘除,还可以实现对三角函数,对数,指数等高级运算的功能。科学计算器:包括加,减,乘,除,三角函数运算,指数运算,对数运算,幂运算,求余运算。具体实现private string op; private double op1; private double op2; private double result; publi

2021-04-28 01:10:11 591

原创 C#基本语法

文章目录高级窗体控件图形和图像类控件ImageList控件列表视图控件创建列表视图控件使用列表视图控件树视图控件添加和删除树节点DateTimePicker控件MonthCalender控件更改MonthCalender控件的外观其他高级控件使用ErrorProvider控件验证文本框输入高级窗体控件图形和图像类控件ImageList控件ImageList控件不能显示图像,必须要借助其他控件显示。借助PictureBox控件。private void Form1_Load(object sende

2021-04-27 21:48:57 1855

原创 C#基本语法

文章目录窗体控件Form窗体窗体的添加与删除窗体的属性窗体的常用事件MDI窗体设置MDI窗体设置MDI子窗体排列MDI窗体文件类控件选择类控件下拉组合框控件复选框控件单选按钮控件数值选择控件列表控件分组类控件容器控件分组框控件选项卡控件菜单栏,工具栏和状态栏控件工具栏控件窗体控件Form窗体窗体的实质是利用System.Windows.Forms.Form类或者是该类的派生类来创建的。查看代码后,发现类Form1继承于Form类窗体的添加与删除添加:右击项目名称Form,弹出的快捷菜单选择 添

2021-04-27 01:23:51 457

原创 C#基本语法

文章目录字符串字符串的基本操作字符串大小写转换字符串的比较Equals字符串的格式化字符串的截取字符串的分割字符串的合并字符串的插入字符串的填充字符串的删除字符串的修剪字符串的复制字符串的替换StringBuilder类定义设置StringBuilder类的容量追加操作插入操作删除操作替换操作正则表达式Regex类Match类集合与泛型常用集合类型动态数组堆栈类队列类Hashtable类Dictionary类字符串字符串的基本操作字符串大小写转换string str = "Study hard an

2021-04-26 12:38:37 933

原创 C#基本语法

文章目录程序流程控制foreachgoto数组程序流程控制foreach语法格式为:foreach(类型 标识符 in 集合){循环代码}例子如下:通过foreach循环长出字符数组0和1的个数并输出 int x = 0, y = 0; char[] ch = new char[] { '0', '1', '0', '1', '1', '1', '0', '0', '1', '0', '0' }; Console.WriteLine(ch);

2021-04-25 23:19:04 412

原创 C#基本语法

文章目录输出为了避免闪退现象system命名空间控制台输出console.write(),console.writeline()使用索引输出,索引号必须从0开始不间断顺延只能输出object数组,其他数组不可以输出数组元素的指定位置控制台输入ReadKey()方法Read()方法ReadLine()方法.NET Framework基本语法解决方案文件和项目文件以及类文件之间的关系常量与变量引用类型与值类型常量与变量值类型与引用类型的区别数据类型object类型dynamic类型装箱和拆箱数据类型之间的转换使

2021-04-24 23:15:28 1984

原创 剑指 Offer 03. 数组中重复的数字

剑指 Offer 03. 数组中重复的数字题目解题思路c++思路一思路二题目找出数组中重复的数字。在一个长度为 n 的数组 nums 里的所有数字都在 0~n-1 的范围内。数组中某些数字是重复的,但不知道有几个数字重复了,也不知道每个数字重复了几次。请找出数组中任意一个重复的数字。示例 1:输入:[2, 3, 1, 0, 2, 5, 3]输出:2 或 3限制:2 <= n <= 100000解题思路c++思路一直接利用hash表存储,然后大于2的直接返回。class

2021-02-08 20:43:46 67

原创 1088 Rational Arithmetic (20分) 思路分析 测试点分析(解决你的测试点过不了)

题目For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient.Input Specification:Each input file contains one test case, which gives in one line the two rational numbers i

2020-06-08 03:11:00 638

原创 1081 Rational Sum (20分) 思路分析 测试点分析(解决你的测试点过不了)

文章目录题目题目大意思路分析测试点分析代码题目Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum.Input Specification:Each input file contains one test case. Each case starts with a positive integer N (≤100), followed in the ne

2020-06-07 21:05:59 502

原创 1012 The Best Rank (25分) 测试点分析 思路分析

文章目录题目题目大意思路分析测试点分析代码总结题目To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algrbra), and E - English. At the mean time, we en

2020-05-26 13:19:11 1105 1

原创 1027 Colors in Mars (20分) 思路分析+测试点分析

文章目录题目题目大意分析测试点分析codecode1code2题目People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, and th

2020-05-24 11:13:53 311

原创 1031 Hello World for U (20分)

文章目录题目题目大意思路分析总结题目Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as:h de ll rlowoThat is, the characters must be printed in the original order, star

2020-05-21 16:51:00 178

原创 1046 Shortest Distance (20分)思路分析+测试点分析

文章目录题目题目大意分析代码总结题目The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input Specification:Each input file contains one test case. For each case, the

2020-05-20 22:19:07 197

原创 1042 Shuffling Machine (20分) 思路分析

文章目录题目题目大意分析代码反思题目Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid “inside jobs” where employees collaborate with gamblers by performing inadequate shuffles,

2020-05-20 20:36:23 151

原创 2020.5.10

文章目录今天解决了一个困扰我很久的1082,具体的写法见今天的博客。然后写了三个查找元素的题,没什么难度。最后写了一个模拟多项式相加的题,注意控制格式和只有非0的情况才输-出。。。今天写的都是开头的第一,第二个题,不难。感觉自己进度挺慢,心里难免有些焦灼o(╥﹏╥)o...

2020-05-10 19:44:37 90

原创 1082 Read Number in Chinese (25分) 解析

文章目录解决方法题目大意解决思路代码后记Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output Fu first if it is negative. For example, -123456789 is read as Fu yi Yi er Qian san Bai si Shi wu Wan liu Qian qi Bai ba Sh

2020-05-10 14:52:25 155

原创 2020.5.7

今天刷pat写了几个简单的数学问题的题,难度不大1008 这个题没啥难的,只是注意一下,如果要到达的楼层就是当前楼层,是需要停留5秒的!1049 暴力解法会超时,这里需要用到是的左右数分离这个数学模型。其规律为:此处参考了1049 Counting Ones (30 分)数学建模——左右数分离...

2020-05-07 05:36:04 111

原创 2020.5.6

今天开始二刷PAT今天从9.50写了几个字符串处理的题,难度小,属于pat第一个题。1001 注意的是字符串的位置,有些傻傻分不清,举了一个例才明白数量关系。1035 注意输出时单复数形式。。1061 坑点在于字符串根据大写输出时,注意分别对应的范围,一定要注意!...

2020-05-06 00:59:55 99

原创 PAT 图的遍历总结

文章目录定义分类基本实现DFSBFS典型例题定义从图中的某个顶点出发访问遍图中的所有顶点,并且每个顶点仅仅被访问一次。分类♦ DFS♦ BFS基本实现DFSBFS典型例题DFS:1013 Battle Over Cities (25分)1034 Head of a Gang (30分)DFS+并查集1021 Deepest Root (25分)BFS:1076 For...

2020-05-02 04:30:31 208

原创 1076 Forwards on Weibo (30分) BFS

文章目录问题解决方法题目大意解题思路BFS模板问题1076 Forwards on Weibo (30分)Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a so...

2020-05-02 03:54:10 159

原创 PAT 甲级并查集总结

文章目录定义基本操作具体实现代码模板实战例题定义并查集(Disjoint-Set)是一种可以动态维护若干个不重叠的集合,并支持合并与查询两种操作的一种数据结构。基本操作init():初始化Union(int x,int y):合并两个元素findfather(int x):v找元素的所属集合具体实现我们建立一个数组father[]表示一个并查集,father[i]表示i的父节点。...

2020-05-01 13:28:31 176

原创 1118 Birds in Forest (25分)

文章目录问题解决方法问题Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are supposed to help the scientists to ...

2020-05-01 13:26:15 127

原创 1021 Deepest Root (25分)

文章目录题目解决方法题目A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree...

2020-05-01 13:21:07 111

原创 1107 Social Clusters (30分)

文章目录问题解决方法题目大意解决方法后记问题When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A social cluster is a set of peop...

2020-05-01 11:41:48 205

原创 1034 Head of a Gang (30分)DFS+并查集

文章目录解决方法题目大意解题方法DFS并查集后记One way that the police finds the head of a gang is to check people’s phone calls. If there is a phone call between A and B, we say that A and B is related. The weight of a re...

2020-04-30 11:29:08 125

原创 1013 Battle Over Cities (25分)

文章目录问题解决方法题目大意dfs并查集问题It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must kn...

2020-04-28 21:19:30 124

原创 1040 Longest Symmetric String (25分)

文章目录问题解决方法题目大意思路暴力解法马拉车问题Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given Is PAT&TAP symmetric?, the longest symmetric sub-string is ...

2020-04-25 17:13:15 133

原创 1057 Stack (30分)

文章目录问题解决方法后记问题Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element onto the top ...

2020-04-22 20:19:03 107

原创 1014 Waiting in Line (30分)

文章目录问题解决方法题目大意思路后记问题Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait i...

2020-04-22 10:55:46 180

原创 1017 Queueing at Bank (25分)

文章目录问题解决方法题目大意第一次代码思路第二次代码(更好)思路后记问题Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers hav...

2020-04-21 09:51:35 93

原创 1105 Spiral Matrix (25分)

问题This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix is filled in from the first element at the upper-left corner, then move...

2020-04-20 23:57:55 147

原创 1057 Stack (30分)

文章目录问题问题1057 Stack (30分)Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element on...

2020-04-11 10:02:04 70

原创 1045 Favorite Color Stripe (30分)

文章目录问题解决方法后记问题1045 Favorite Color Stripe (30分)Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off tho...

2020-04-10 19:22:29 158

原创 1007 Maximum Subsequence Sum (25分)

文章目录问题解决方法后记问题Given a sequence of K integers { N​1​​, N​2​​, …, N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i+1​​, …, N​j​​ } where 1≤i≤j≤K. The Maximum Subsequence is the continuo...

2020-04-10 18:23:20 96

原创 1021 Deepest Root (25分)

文章目录问题解决方法问题A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree...

2020-04-10 16:41:35 73

原创 1013 Battle Over Cities (25分)

文章目录问题解决方法dfs并查集后记问题It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know...

2020-04-10 10:16:45 82

原创 1107 Social Clusters (30分)

文章目录问题解决方法后记问题When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A social cluster is a set of people who h...

2020-04-08 12:35:56 105

原创 1099 Build A Binary Search Tree (30分)

文章目录问题解决方法后记问题A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node's key...

2020-04-07 15:07:50 113

原创 1064 Complete Binary Search Tree (30分)

文章目录问题解决方法问题A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node's key....

2020-04-07 13:33:41 107

原创 1043 Is It a Binary Search Tree (25分)

文章目录问题解决方法后记问题A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node's key...

2020-04-07 13:31:13 90

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除