7-37 Xiaoming typing (10 points) (data structure) The simplest code to write the simplest data structure
Xiao Ming is typing a document using Microsoft Word. The document contains only a-z lowercase letters and spaces. During typing, the Home key, End key, _arrow key, _arrow key, Insert key, Backspace key may be pressed one or more times. Write a program that gives Xiao Ming the sequence of keys on the keyboard and outputs the final text displayed ...
Posted by Otoom on Wed, 06 Oct 2021 15:29:22 -0700
Basic review of C + + introduction
sizeof keyword
The sizeof keyword can be used to count the memory size occupied by the data type Syntax: sizeof (data type / variable) int main() {
cout << "short Memory space occupied by type: " << sizeof(short) << endl;
cout << "int Memory space occupied by type: " << sizeof(int) << endl;
cout << ...
Posted by wisewood on Wed, 06 Oct 2021 08:34:10 -0700
"C + + language programming basics" learning and objects
Lifetime of variable: static keyword modifies a local variable. The local variable has a global lifetime, but the local variable is visible. If it leaves the scope, it will not be released int i = 1;//i is a global variable with static lifetime.
void other() {
static int a = 2;
static int b; ...
Posted by elentz on Wed, 06 Oct 2021 05:57:32 -0700
Hand tear C language advanced --- file operation
catalogue
What is a file
file name
file type
file buffer
field name pointer
Opening and closing of files
fopen and fclose
Sequential reading and writing of files
fputc
fgetc
fputs
fgets
fwrite
fread
Random reading and writing of files
fseek
ftell
rewind
Document end judgment
What is a file
Files on disk are files. Bu ...
Posted by AMV on Tue, 05 Oct 2021 15:03:26 -0700
PAT class a -- Complete Binary Search Tree (30)
More answers to PAT class a questions –
acking-you.github.io
subject
OJ platform
Topic analysis
Main idea of the title:
Binary search tree is no stranger to everyone. This problem requires you to construct a binary tree. The binary search tree is also a complete binary tree, and then print out its sequence traversal sequence ...
Posted by Talguy on Tue, 05 Oct 2021 13:15:47 -0700
1095 decoding PAT admission card (25 points)
PAT admission number consists of 4 parts:
The first is the level, that is, T stands for the top level; A stands for class A; B stands for class B; The 2nd to 4th digits are the examination room number, ranging from 101 to 999; The 5th ~ 10th place is the examination date, with the format of year, month and day, accounting for 2 places in seque ...
Posted by mdomel on Mon, 04 Oct 2021 13:53:38 -0700
go language basic data types
go language basic data types
Go is a strongly typed language. This means that each variable you declare is bound to a specific data type and accepts only values that match this type.
Go has four types of data:
Basic types: numbers, strings, and BooleansAggregate types: arrays and structuresReference types: pointer, slice, map, function, and ...
Posted by phplearner on Sun, 03 Oct 2021 18:43:26 -0700
Insertion, search, deletion, sorting and inversion of single linked list in data structure of C language version
preface
The function definition, header file, structure type and main function in this paper
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
typedef struct LINK{
int data;
struct LINK* next;
}*link;
link createlink(link );
void outlink(link );
void menu(link );
void deletelink(link );
link findlink(link ); ...
Posted by dcampbell18 on Sun, 03 Oct 2021 18:26:09 -0700
Hand to hand teaching: introduction of character function and Its Simulation Implementation
1. Find string length function
Usage and Simulation Implementation of strlen
strlen() function: this function calculates the number of characters in the string from the first character until it encounters an empty character, that is' \ 0 ', and then returns the length of the calculated number of characters, including' \ 0 '.
Next, let's ...
Posted by Megienos on Sun, 03 Oct 2021 16:37:51 -0700
Flexible array @ dynamic memory management
🔑 Citation:
Perhaps you have never heard of the concept of flexible array, but it does exist. In C99, the last element in the structure is allowed to be an array of unknown size, which is called a "flexible array" member.
To make the array size controllable, it is necessary to cooperate with dynamic memory development.
Fo ...
Posted by reto on Sun, 03 Oct 2021 11:14:56 -0700