- 博客(5)
- 收藏
- 关注
原创 LeetCode-31 下一个排列
class Solution { public: void nextPermutation(vector<int>& nums) { int index = nums.size()-2; while(index>=0&&nums[index]>=nums[index+1]){ --index; } if(index>=0){ .
2021-10-21 17:43:42
127
原创 C#控制台、随机数相关部分方法
using System; namespace 必备知识点_控制台相关 { class Program { static void Main(string[] args) { Console.WriteLine("控制台相关"); #region 知识点一 复习输入输出 //输出 //Console.WriteLine("123"); /.
2021-08-25 21:48:03
312
原创 C#运算符
一、字符串拼接: 1.operator + string str = "wa"+"o"; 2.string.Format方法 语法:string.Format("format",args...) string str=string.Format("I'm {0},{1}岁,想要{2}", "lzcc", 23, "shuijiao"); 3.控制台打印拼接 Console.WriteLine("I'm {0},{1}岁,想要{2}", "lzcc...
2021-08-24 18:17:30
163
原创 C#异常捕获
作用:避免代码报错时,造成程序卡死 using System; namespace ConsoleApp1 { class Program { static void Main(string[] args) { //必备部分 try { //希望进行异常捕获的代码块放到try中 //如果try中的代码报错了 不会让程序卡死 ...
2021-08-24 17:40:02
251
原创 C# 类型转化
隐式转换:(低精度向高精度,小范围向大范围,包括有无符号) int i = 10; long l=i;//true decimal de=2.231932//(double),false 显式转化: 1.括号强转 可以实现一些隐式中非法的操作(截断法) float f=(float)2.21321//C#临时变量浮点数为double类型 2.Parse方法 bool b=bool.Parse("true");//Parse意为语法分析,即string转其他类型 3.Convert方法
2021-08-24 17:12:38
795
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅