Category:C

  • Oulipo substring lookup

    Time:2020-1-24

    Title Description thinking Use the hash value to represent the value of the substring of the long string, and directly compare whether the hash values are equal Code #include #include using namespace std; char a[1000005], b[1000005]; unsigned int sum[1000005], sumb, bt[1000005]; int bs = 37, ans; int lena, lenb; unsigned int get(int st) { return […]

  • C + + implementation of simple perpetual calendar

    Time:2020-1-24

    In this paper, we share a simple perpetual calendar implemented by C + + for your reference. The details are as follows The code is as follows: /* *File name: perpetual calendar.cpp *Author: Chenghan *Completion date: January 10, 2019 *Version No.: 1.0 *Problem Description: make a simple perpetual calendar */ #include<iostream> #include <string> using namespace […]

  • C regular expression

    Time:2020-1-23

    C regular expression Reference tutorial: https://github.com/ziishanned/learn-regex/blob/master/translations/readme-cn.md Under Linux, there are three main functions for regular expressions #include #include //Build rule int regcomp(regex_t *preg, const char *regex, int cflags); //Target string to match int regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags); //Free memory void regfree(regex_t *preg); Parameter cflags of function regcomp […]

  • C language to realize the perpetual calendar applet

    Time:2020-1-23

    First, gossip I’ve been puzzled since I learned C in my freshman year. How can I use C? It’s not as intuitive as HTML, not as common as SQL, not as powerful as Java, so why does it still exist and still hot? The answer is very simple: programming language is a family, C language […]

  • Hash function

    Time:2020-1-22

    concept The concept of hash belongs to search, it does not take the comparison of keywords as the basic operation, and uses direct addressing technology. Ideally, the expected time to find is O (1). Hash function is a function that changes any input string into a fixed output string. The length of the output string […]

  • Perpetual calendar realized by C language

    Time:2020-1-22

    The perpetual calendar display realized by C language, press the up, down, left and right buttons to change the date and year for your reference, the specific contents are as follows #include <stdio.h> #include <stdlib.h> #include <time.h> #include<conio.h> typedef struct today { int day; int month; int year; } today; int day_cankao[2][13]={ {0,31,28,31,30,31,30,31,31,30,31,30,31}, {0,31,29,31,30,31,30,31,31,30,31,30,31} }; […]

  • The realization of calendar by month in C language

    Time:2020-1-21

    The example of this paper shares the calendar displayed by month in C language for your reference. The details are as follows First, we will show the final rendering: That’s about it. Let’s talk about the basic idea first: first, calculate the first day of the current year is the day of the week, then […]

  • Binary reactor

    Time:2020-1-19

    What is a binary pile? Binary pile is a special kind of pile. It has the following characteristics: It has the property of complete binary tree. The value of any parent node in the heap is greater than or equal to the value of its left and right child nodes (maximum heap), or less than […]

  • Realization of perpetual calendar program with C language

    Time:2020-1-19

    In this paper, the example of C language for you to share the perpetual calendar program, for your reference, the specific content is as follows #include <stdio.h> int year(int y) { if ((y%4==0) && (y%100!=0) || y%400==0) return 366; else return 365; } int main() { int y; int i,j,sum=0; int begin,week; int days[12]={31,28,31,30,31,30,31,31,30,31,30,31}; scanf(“%d”,&y); […]

  • Introduction to C language

    Time:2020-1-18

    It’s really unpleasant to learn Java and py again. The previous ones are OK. I’ve started to learn them directly, but I’d better record them. After all, I won’t have to go to college hello #include int main() { printf(“hello,world”); return 0; } 1、 Variable definition The form of variable definition is generally as follows:Type […]

  • C language to realize the source code of perpetual calendar

    Time:2020-1-18

    The example of this paper shares the specific code of implementing perpetual calendar in C language for your reference. The specific content is as follows Source code of main function #include <stdio.h> #include <stdlib.h> #include <string.h> Int getweek (int year, int month, int day); // find the day of the week. We’ll be back on […]

  • C language I blog assignment 01

    Time:2020-1-17

    This assignment belongs to that course C Programming II Where are the requirements for this assignment My homework My goal in this course is Understand C language and do a good job of professional planning. This assignment helps me achieve my goal in that specific aspect I have a preliminary understanding of C language and […]