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 {
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 ()
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
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
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};
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
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 {
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
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
// 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 ++ 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
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
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
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
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
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,
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
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
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) {
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
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