printf

Want to know printf? we have a huge selection of printf information on alibabacloud.com

A quick sort of sorting algorithm

Quick sort algorithm, with ascending order as an example Operating system: Ubuntu Compiling software: GCC Results screenshot: Source: #include void quickSort (int *,int,int); int findposs (int *,int,int); int main () {int i;

Find the nearest common ancestor of two nodes in a tree

The sword refers to the last question on offer, and a recursive function has been tuned for an afternoon to get the correct result. Topic Description: Given a tree, it also gives two nodes in the tree, and asks for their lowest common ancestor.

How to arrange the smallest number of arrays

Topic Description: Enter a positive integer array that combines all the numbers in the array into a number, printing the smallest of all the numbers that can be spliced. For example, enter the array {3,32,321}, and print out the smallest number

Algorithm that produces the next permutation number

Full sort: Take M (m≤n) elements from n different elements and arrange them in a certain order, called an arrangement of taking m elements from n different elements. All permutations are called when m=n. For example n=3, the whole sort is: 123, 132,

Binary tree recursive and non-recursive traversal

Binary tree is a very important data structure, many other data organizations are based on the binary Tree Foundation evolved. The binary tree has the front, the middle, and the last three ways to traverse, because the tree itself is defined by

POJ 2240 arbitrage: Shortest Way Floyd

arbitrage:http://poj.org/problem?id=2240 Effect: Give you m currency, give you m currency exchange rules, ask whether through these rules can finally make a profit. Eg:1 dollar for 0.5 pounds, 1 pounds for 10 francs, 1 francs for 0.21 dollars, so

POJ 1860 Currency Exchange: Shortest Way Bellman-ford

Currency exchange:http://poj.org/problem?id=1860 The effect: There are a variety of currencies, can be exchanged between, but the need for fees, that is, both exchange rates and handling charges. Ask if you can make money after the exchange. Train

POJ 3371 Flesch Reading Ease (simulation problem)

Flesch Reading ease:http://poj.org/problem?id=3371 The topic is very water, is to read the question on line. Meaning Give a normative article, ask its sentence number, word number and syllable number to put these 3 values into the title given

POJ 1265 Area (computational geometry) (pick theorem)

area:http://poj.org/problem?id=1265 To give you a point of the horizontal ordinate change value, ask how many points in the polygon, how many points in the polygon, and the area of the polygon. Idea: Pick theorem. A polygon area formula for

POJ 3218 TOYS (computational geometry) (two points)

toys:http://poj.org/problem?id=2318 To give you a box, there are n panels separated into n+1 parts, give you the coordinates of the M toy, ask each part has several toys. Train of thought: to each toy, the two-segment subscript, judge the toy in

HDU 2985 Another Lottery (water title)

HDU 2985:http://acm.hdu.edu.cn/showproblem.php?pid=2985 Effect: To you n individual, each person buys the M time lottery ticket, the first time bonus is 2 I second side, asks each person to win more than other people's likelihood is many. Ideas:

POJ 3792 Area of Polycubes: Simulation

POJ 3792:http://poj.org/problem?id=3792 Effect: In order to give you a bunch of cubes, if the current input of the cube before and after the upper and lower sides are not connected with the previous cube, output no, and output is currently the

POJ 2653 Pick-up STICKS: Compute geometry for segment intersections

POJ 2653:http://poj.org/problem?id=2653 The idea is very simple, that is, on the ground in order to sprinkle a pair of sticks, to see how many are finally pressed, the output is not pressed the number of the stick. A bit of a pit is not clear how

Hdu 1174 detonation head (three-dimensional spatial point and straight line relation)

HDU 1174:http://acm.hdu.edu.cn/showproblem.php?pid=1174 The main idea: Chinese problem, very good understanding, make clear various variables on the line. Train of thought: I know there seems to be two solutions, one is to seek the head of the

Decimal conversion to 16-in and 16-to-2 implementation of the system

#include #include #include #include int main () {I NT I,v; Char bs[33]; Char b[33]; Char hs[9]; Char h[9]; Char s[4]; Char *e; Decimal integer to binary string; i=1024; Ltoa (i,b,2); sprintf (BS, "%032s", b);

CSU 1414:query on a tree

Preprocessing the number of sub nodes of each node sons, then the query to X can be obtained by sons[x]-Sigma (Sons[v) (V is the point to X distance to D) How to find these v quickly? Notice that the point from X to D is definitely on the same

By judging the prime number and then randomly finding an even number equal to two primes.

#include #include int zhi (int num) { int m = sqrt (num); for (int i = 2; I

How to judge the number and then output 6=1+2+3 28=1+2+4+7+14

#define _crt_secure_no_warnings #include #include int f (int num) { int index = 0; int sum=0; int a[50]; for (int i = 1; i

How to find the elements and 4*4 of each backslash in N-order matrix

#include void Main () {//00-11-22-33 the first slash is the second 10-21-32 int arr2[4][4] = {00, 01, 02, 03, 10, 11, 12, 13, 20, 21, 22, 23, 30, 31, 32, 33,}; int I, J; int sum = 0; int

To query a string with a pointer and replace the specified character in it

#define _crt_secure_no_warnings #include #include #include

Related Tags:
Total Pages: 42 1 .... 16 17 18 19 20 .... 42 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.