C language: Use the parameters of the main function to implement an integer computer.

C language: Use the parameters of the main function to implement an integer computer. # Include # include # include int calculator (int num1, char * p, int num2) {if (p = "-a") return num1 + num2; else if (p = "-s") return num1-num2; else if (p =

Replacement of String Array spaces in C Language

Replacement of String Array spaces in C LanguageProblem description: String Replacement space: implement a function to replace each space in the string with "% 20 ". For example, if "we are happy." Is input, "we % 20are % 20happy." Is output .".

[C Language] implement strcmp

[C Language] implement strcmp # Include # include int my_strcmp (const char * str1, char * str2) {int ret = 0; assert (str1); assert (str2); while (* str1 = * str2) & * str1 & * str2) {str1 ++; str2 ++; while (! (* Str1 & * str2) // checks

C language: Uses Bubble sorting to sort multiple strings (optimized ).

C language: Uses Bubble sorting to sort multiple strings (optimized ). # Define _ CRT_SECURE_NO_WARNINGS 1 # include # include # include int main () {char * str [] = {"hello", "change", "world", "come", "on"}; // pointer array, each is a

C language: how to optimize the sorting of a group by the bubble method?

C language: how to optimize the sorting of a group by the bubble method? # Define _ CRT_SECURE_NO_WARNINGS 1 # include # include int main () {int arr [] = {5, 6, 7, 8, 9, 1, 2, 3, 4}; int I = 0; int j = 0; int flag; int size = sizeof (arr)/sizeof

[C Language] implement strncat

[C Language] implement strncat # Include # include char * my_strncat (char * strDest, const char * strSrc, int I) {char * start = strDest; assert (strDest! = NULL) & (strSrc! = NULL); while (* strDest ++); // until \ 0 jumps out of the while LOOP

Bitwise OR of C Language

Bitwise OR of C LanguageSymbol: ^ returns an exclusive bitwise OR. Rule: The same is zero, and the difference is one. For example, only one number appears in a group of data. All other numbers are paired. Find this number. (Using bitwise operations)

The most powerful of C language-pointer

The most powerful of C language-pointerPointers are inseparable from addresses. When we mention pointers, we should think of addresses, because in C language, the value of pointer variables is an address. With this value, it can point to the memory

Enable "mentally retarded" board games in C Language

Enable "mentally retarded" board games in C Language # Define _ CRT_SECURE_NO_WARNINGS # include # include /* function declaration */void Init_Arr (int arr [] [3]); // array initialization void Print_Checkerboard (int arr [] [3]); // print the

[C Language] Left-hand string

[C Language] Left-hand string To implement a function, you can use k characters in the left-hand string. Method 1: open another array and write the characters After k + 1 into this array first, write the k characters to be left-handed as follows: #

The first guess digital game in C Language

The first guess digital game in C Language # Include # include # include # include # include # include # include void output () {printf *********** * *********** \ n "); printf ("********************** enter 1 to enter the guess digital game *

Objective-C -- Category

Objective-C -- Category Encapsulation is a feature of object-oriented, and OC is no exception, but sometimes we will encounter such a situation. For example, I encapsulate a class and don't want to change it any more, however, as the program

C monkey eat peach

C monkey eat peachThe monkey has a peach problem. On the first day, the monkey picked several peaches and immediately ate half of them. They were so addicted that they ate another one. The next morning, I ate another half of the remaining peaches,

Implementation of simple physics problems in C Language

Implementation of simple physics problems in C LanguageProblem: A ball falls freely from a 100-meter-tall place. After each landing, it jumps back to half of the original height, then drops, and then rebounds. Ask how many meters a total of 10th

[C Language] implement strstr Functions

[C Language] implement strstr Functions # Include # include char * my_strstr (const char * str1, const char * str2) {assert (str1); assert (str2); char * p = str1; // record the initial position of str1 char * s1 = p; // record the initial

C language. Enter multiple lines of information on the terminal to find the lines containing the "could" and print and modify the lines.

C language. Enter multiple lines of information on the terminal to find the lines containing the "could" and print and modify the lines. # Define _ CRT_SECURE_NO_WARNINGS 1 # include # include # include # define MAX 1000int getline (char * line,

A simple three-game (implemented in C)

A simple three-game (implemented in C)The question is: in a 3*3 matrix, the chess party has three consecutive sub-members and the winning code is as follows: # Include # include # include char arr [3] [3] = {0}; // All functions that directly

C function implementation to determine whether a number is a prime number

C function implementation to determine whether a number is a prime number # Include # include # define YES 1 # define NO 0 void main () {int n; int Prime_num (int n); // declare the Prime_num function printf ("please enter a number: "); scanf (" %

The decimal rounding method is as follows:

The decimal rounding method is as follows: Recently, I found that there was a problem with the code rounded down. I checked the information on the network and recorded the information for future query. Principle: enlarge the data, and then use the

Basic operations of two-way linked list in C Language

Basic operations of two-way linked list in C Language // Header file # pragma once typedef int DataType; typedef struct LinkList {DataType _ data; struct LinkList * _ next; struct LinkList * _ prev;} LinkList, * pLinkList; void InitList (pLinkList

Total Pages: 275 1 .... 174 175 176 177 178 .... 275 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.