自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 go 中 使用 switch时 scanf的使用注意事项(switch中的scanf无法接收输入)

在做一个练习的时候,需要在输入switch的key后,再针对不同的情况再次进行输入,如下:fmt.Scanf("%d",&key) switch key { case 1: ... case 2: fmt.Scanf("%f",&income) fmt.Printf("%.2f", income) case 3: fmt.Scanf("%f",&expenditure) fmt.Printf("%.2f",expenditure

2021-09-10 15:45:57 519

原创 /etc/hostname 与 /etc/hosts 的区别

/etc/hostname 中存放的是主机名/etc/hosts 存放的是域名与 ip 的对应关系,域名与主机名没有任何关系,可以为任何一个IP指定任意一个名字,hosts 文件的一个例子:127.0.0.1 localhost127.0.1.1 xxx...

2021-07-07 10:19:40 151

原创 【Leetcode】删除排序数组中的重复项(JAVA)

题目:给定一个排序数组,你需要在原地删除重复出现的元素,使得每个元素只出现一次,返回移除后数组的新长度。不要使用额外的数组空间,你必须在原地修改输入数组并在使用 O(1) 额外空间的条件下完成。示例1:给定数组 nums = [1,1,2], 函数应该返回新的长度 2, 并且原数组 nums 的前两个元素被修改为 1, 2。 你不需要考虑数组中超出新长度...

2020-05-07 18:23:14 165

原创 【PAT】1112 Stucked Keyboard (20分)(模拟 字符串处理)

题目:On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear repeatedly on screen forktimes.Now given a ...

2020-05-06 11:02:09 138

原创 【PAT】1077 Kuchiguse (20分)(模拟 字符串处理)

题目:The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker's personality. Such a preference is c...

2020-05-06 09:22:04 254

原创 【PAT】1035 Password (20分)(模拟 STL vector)

题目:To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish1(one) from...

2020-05-05 21:52:05 118

原创 【PAT】1005 Spell It Right (20分)(模拟 字符串处理)

题目:Given a non-negative integerN, your task is to compute the sum of all the digits ofN, and output every digit of the sum in English.Input Specification:Each input file contains one test cas...

2020-05-05 13:56:12 121 1

原创 【PAT】1063 Set Similarity (25分)(模拟 STL set)

题目:Given two sets of integers, the similarity of the sets is defined to beN​c​​/N​t​​×100%, whereN​c​​is the number of distinct common numbers shared by the two sets, andN​t​​is the total numb...

2020-05-05 11:29:08 136 1

原创 【PAT】1047 Student List for Course (25分)(模拟 STL map vector)

题目:Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.I...

2020-05-05 10:42:25 117

原创 【PAT】1039 Course List for Student (25分)(模拟,STL map vector)

题目:Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who ...

2020-05-05 10:07:58 110

原创 【PAT】1054 The Dominant Color (20分)(模拟 STLmap)

题目:Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called...

2020-05-04 15:23:58 90

原创 【PAT】1065 A+B and C (64bit) (20分)(模拟)

题目:Given three integersA,BandCin [−2​63​​,2​63​​], you are supposed to tell whetherA+B>C.Input Specification:The first line of the input gives the positive number of test cases,T(≤10...

2020-05-04 14:57:24 142

原创 【PAT】1046 Shortest Distance (20分) (模拟)

题目:The task is really simple: givenNexits 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...

2020-05-04 14:37:30 103

原创 【PAT】1124 Raffle for Weibo Followers (20分)(模拟 字符串处理)

题目:John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from every N followers who forwarded his post, an...

2020-05-04 13:15:37 159

原创 【PAT】1140 Look-and-say Sequence (20分) (模拟 字符串处理)

题目:Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ...whereDis in [0, 9] except 1. The (n+1)st number is a kind of description of the...

2020-05-04 12:18:04 138

原创 【PAT】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 g...

2020-05-04 11:12:02 105

原创 【PAT】1011 World Cup Betting (20分)(比较 模拟)

题目:With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Afri...

2020-05-04 09:56:42 160

原创 【PAT】1036 Boys vs Girls (25分) (比较 模拟)

题目:This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.Input Specification:Each input file contains...

2020-05-03 21:09:16 182

原创 【PAT】1006 Sign In and Sign Out (25分) (比较 模拟)

题目:At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in's and out'...

2020-05-03 19:10:31 101

原创 【PAT】1008 Elevator (20分) (模拟)

题目:The highest building in our city has only one elevator. A request list is made up withNpositive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs...

2020-05-03 17:21:33 123

原创 【PAT】五一线上测试

准备了一周测试一下自己,难度为乙级,确实不难,但是我对STL各种不熟,还是花费了好多时间!!!引以为戒!勤加练习!一 洗牌算法(k什么洗牌算法我忘了)因为几分钟就做出来了所以忘记复制题目了...题意大概是给一个数N表示需要被洗的牌的个数,给一个随机序列{X,X,X...X},然后根据洗牌算法来打乱顺序的{1,2...N}输入:NX X X...X(输入样例我真的记不得了...

2020-05-01 22:11:49 247

原创 【c++】随机生成车牌号

主要思想:使用c++自带的随机函数(以时间为随机数种子)生成随机城市和字母+随机数字的组合(有需要的话再继续改动后面的五位序号码)借用了这位朋友的省份字符串数组(京A,京B什么的……)https://blog.csdn.net/dalter/article/details/82423209用到的头文件:#include<iostream>#include ...

2019-04-08 16:31:42 4838

空空如也

空空如也

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

TA关注的人

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