- 博客(8)
- 收藏
- 关注
原创 1052 Linked List Sorting (25 分)
A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integerkeyand aNextpointer to the next structure. Now given a linked list, you are supposed to sort the structures...
2022-03-03 17:14:27
178
原创 1056 Mice and Rice (25 分)
Mice and Riceis the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much rice as possible in order to become a FatMouse.First the p.
2022-03-03 15:05:00
176
原创 1039 Course List for Student (25 分)
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 comes for a query.Input Specification:Each input file cont
2022-02-27 19:40:52
130
原创 1085 Perfect Sequence (25 分)
Given a sequence of positive integers and another positive integerp. The sequence is said to be aperfect sequenceifM≤m×pwhereMandmare the maximum and minimum numbers in the sequence, respectively.Now given a sequence and a parameterp, you are s...
2022-02-25 11:18:07
107
转载 C++中把数组复制到另一个数组中
有两种方式:一、进行数组遍历,依次赋值 int arr1[5] = { 1, 2, 3, 4, 5 }; int arr2[10] ={ 0 }; for(int i=0;i<sizeof(arr1)/sizeof(int);i++) arr2[i] = arr1[i] ;该段程序功能是遍历数组arr1,逐个赋值到数组arr2对应元素中。二、借用内存复制函数memcpy,整体赋值void *memcpy(void *dst, void *src, zize_t
2022-02-13 18:45:40
11063
原创 PAT中不支持gets
PAT中:error: ‘gets’ was not declared in this scopegets(str);原因:gets()方法已经不被PAT编译器支持了,因此要采用其他方法。header添加:#include <iostream>using namespace std;将gets(str);改为:cin.get(str,n);//n为str数组的长度...
2022-02-01 15:59:32
796
原创 0x00007FF9A7F72079 (ucrtbased.dll)处引发的异常: 0xC0000005: 写入位置 0x000000094D100000 时发生访问冲突
此类型错误,需要更改为其temp中name数组的长度,在scanf_s中需要添加,在scanf中不需要。
2022-01-27 14:30:43
17543
3
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人