On that day, the instructor gave a question and asked us to do it without recursion or loop ~ Sum of 100?
I wrote a code and sent it out today to see if you have any other good methods! I hope I can leave a message in a good way ,,,
The Code is as
The source code of the screenshot program is available everywhere on the Internet, but it basically does not support multiple monitors.At one time, I thought it was very difficult to support multiple monitors.
(Demo
Although many people, especially those who have a good understanding of software engineering but have not yet reached the bottle, despise the use of c language to re-do it. They highly recommend c ++ and other OO languages, it is believed that there
1. the compiling environment uses VS2008. During the debugging process, it is found that some code of a function is not correctly executed, and breakpoint debugging is performed in this part of code. It is found that the breakpoint is always
Generally, all we encounter is a small-end scenario. A typical X86 processor is a small-end scenario. However, many powerpc processors can be configured in the big-end mode or small-end mode. Therefore, the previous code is often run well, to the
# Include # Include # Include "random_n.h"
# Define MAX_NUM 100/** Function: the most powerful method to solve the problem** Huge: T = O (N)** Author: Qinzhiguo** Date: 2012-1-30*/
Int MaxSubSum_HighSpeed (int a [], int N){Int ThisSum, MaxSum, I, j;
This is the last lesson in writing the environment. Of course, some articles about writing the environment will be inserted in the future. You can play with the software yourself. It's okay, it's not bad. Don't worry, it's not long to write the
We develop programs in the Linux environment and have to write Makefile by ourselves. A slightly larger project will contain many. c source files.If we use gcc to compile each source file one by one, the efficiency will be much lower. However, if we
Q: How can I swipe my card in the canteen of the E-Science and Technology Department? If the balance on the card is equal to 5, I can cook at will, even if I make more dishes than the balance. The unit price of n dishes is given now. If you buy one
The idea of solving this problem is to calculate the coefficients one by one from the largest to the smallest base.Why can we design algorithms like this:1. n = a0 + a1 * p0 + a2 * p0 * p1 + a3 * p0 * p1 * p2 + ..., it indicates that every n of the
The implementation of the itoa and atoi functions should be a common question in the interview. Now, I want to write two functions to facilitate quick response when necessary.
[Cpp] // 0 indicates an error.Int atoi (char * str){Int len = lstrlenA
1. Basic explanationTypedef is a key word in C language. It defines a new name for a data type. The data types here include internal data types (int, char, etc.) and Custom Data Types (struct, etc ).In programming, typedef is generally used for two
Given a tree with n nodes, the remaining branches after deleting a node will certainly have the maximum number of nodes, and the minimum value of the maximum number of branch nodes for all nodes is obtained.
Solution: Tree DP. the first deep search
First version:[Cpp]# Include // The following is the all-round comparison function. a> B returns an integer. a # Define COMPARE (TYPE, a, B) (TYPE) a-(TYPE) B) Int main (int argc, char * argv []){Double a = 1, B = 1.5, c;Int x = 10, y = 1, z;Char m
Both perl and C languages provide message queue mechanisms, and message queues can be compatible with each other. when the system architecture is involved, the core computing module can be implemented in C language, and the business logic layer can
Introduction
Just say no, fake tricks.
In this section, we will conduct an experiment and use the C language to implement a simple lexical analyzer to deepen our understanding of lexical analysis. If you are interested, analyze the source code by
HashTable is a very important structure in practical applications. The following describes a simple implementation. Although simple, all of this is still available.
1. access interface
Create a hashtable.
Hashtable hashtable_new (int size) // size
In these cases, a small project or an executable file composed of several independent files is required to have some simple output, including logs and abnormal exit. However, we do not want to install some open-source log packages similar to glog
[Plain]/* Start the comments in the program header (to avoid any problems encountered during the submission of blog posts, the slash used to indicate that the comments have been deleted)* Copyright and version Declaration of the program* All rights
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.