C language example 13:

Question requirements: Input score, output score level a B c d e by score,The value above 90 is.80-89 is divided into B70-79 is divided into C60-69: dBelow 60: E   # Include void main () { int A; scanf ("% d ", & A); if (a> = 90 & A {

C language example 15:

Question requirement: Calculate the prime number within the first 100, and use an array. Solution: It is mathematical to stipulate that if a number cannot be divisible by all its prime numbers, it must be a prime number. # Include void main ()

C language example 17:

Requirement: Write a function to connect two strings.   # Include # include void CAT (char a [], char B []) { int I, J, K; I = strlen (a); J = strlen (B); for (k = 0; k { A [I ++] = B [k]; } A [I] = '/0 '; puts (a); } void main () { char a

C language example 19:

Question requirement: Write a function to print the Student Score. The array contains three student data records, each of which includes num, name, score [3]. input these records using the main function, enter the student ID and output the student

C language example 25:

Requirement: one-dimensional array to implement the Yang Hui triangle   # Include void main () { int I, j, X; // X, Y is two counters, X indicates the number of rows to be displayed. scanf ("% d", & X); int A [20] = {1 }; int B [20] = {1};

C language example 22:

Requirement: Use a pointer to implement the strlen Function   # Include int mystrlen (char * P); void main () { char ch [10]; printf ("input string content/N"); gets (CH ); printf ("the Valid String Length is % d/N", mystrlen (CH); } int

C language Example 16:

Question requirements: Two-dimensional array implementation of the Yang Hui triangle   # Include void main () { int I, J; int A [10] [10] = {1}; // a maximum of 10th rows can be displayed here for (I = 0; I { A [I] [0] = 1; for (j = 0; j {

[Programming skills] bool variable optimization statement in C ++

We usually declare the bool variable as follows:   ClassCmyclass {...Bool m_bvar1;Bool m_bvar2;Bool m_bvar3;Bool m_bvar4;Bool m_bvar5;Bool m_bvar6;Bool m_bvar7;Bool m_bvar8;...}; Considering that the bool variable is actually an int in Win32

C language example 14:

Requirement: Calculate the first 100 prime numbers   #include void main () { int I; int x = 2; // natural number int sum = 0; // Number of prime numbers while (sum { for (I = 2; I { If (X % I = 0) // if it can be deprecated, there is no

From function pointer to proxy (C # getting started with proxy)

// Function pointer in C, which may be better understood # Include "stdafx. H"# Include "stdio. H"# Include "stdlib. H" INT (* test) (int l); // defines the function pointer // The following two processing functions are defined. The program calls

C ++ virtual Summary

C ++ is an object-oriented language, but unlike C # and Java, it has no reflection mechanism. No reflection mechanism makes C ++ somewhat different from other languages in terms of language design, mainly reflected in intelligence. Many things have

C language example 23:

Requirement: enter two numbers to obtain the maximum Convention and least common multiple.   # Include void main () { int m, n, x, y; printf ("enter two positive integers/N"); scanf ("% d", & M, & N ); If (M { Y = m; M = N; N = y; } printf

C # Basic Knowledge Organization: Basic knowledge (3) Construction

We define the yschool and yteacher classes. when instantiating an object: Yschool shool1 = new yschool (); shool1.id = 1; shool1.name = "中""; yschool school2 = new yschool (); school2.id = 2; school2.name =" 中 "; If this is the case, the actual

C # basic knowledge sorting: Basic knowledge (4) Inheritance

As mentioned above, three main characteristics of object-oriented are encapsulation, inheritance and polymorphism. The definition of the class in the front is almost thorough. Now let's look at the inherited features.Inheritance is actually an

C # basic knowledge sorting: hiding basic knowledge (7) Methods

As mentioned in inheritance and abstract classes, there are these relationships between child classes and parent classes:Subclass directly uses the parent class method (but the parent class method must be of the public or protected type );The

C # basic knowledge sorting: Basic knowledge (8) interfaces

Abstract classes are introduced before. They feature that subclasses must implement abstract modification. There are also virtual modifier methods. The virtual modifier method subclass can be rewritten or directly used without rewriting. However,

C # basic knowledge sorting: Basic knowledge (10) static

If you want to access the methods or attributes of a class, you must first instantiate the class, and then use the object of the class to add a. Number for access. For example:There is a user class and a class that processes passwords (encryption

Timer stop in C #

The timer is believed to be widely used. It is convenient for you to perform certain operations on a regular basis. However, after the operation is completed, you need to stop the timer. The landlord made such a low-level mistake. The following code

C # organizing basic knowledge (21) delegation (2)

After reading the previous article about delegation usage, we can see http://blog.csdn.net/yysyangyangyangshan/article/details/8252192, public void Description(string programerName, DescriptionDelegate description) {

[Programming skills] how to optimize C ++ string Initialization

In C ++, there are many string variable initialization methods. The most common method is: Wchar szbuffer [128] = {0}; or wchar szbuffer [128] = l ""; In fact, this writing method is less efficient because the compiled assembly code calls the

Total Pages: 5902 1 .... 3704 3705 3706 3707 3708 .... 5902 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.