Practice 1-14 Write a program that prints a histogram of the frequency of each character in the input.The code is as follows:#include //contains information about the standard library. intMain ()//defines a function named Main, which does not accept parameter values. {printf ("====== The histogram of the frequency of the input characters printed ======\n"); unsignedintXst -];//an array of character frequencies. intI, J, C; I= J =
Practice 1-11 How are you going to test the word count program? If there is some kind of error in the program, what kind of input is most likely to find such errors?The code is as follows:#include //contains information about the standard library. #defineIn 1/* within the word */#defineOut 0/* outside the word */intMainvoid)//defines a function named Main, which does not accept parameter values. {printf ("====== counter Program ======\n"); intC, NL, NW, NC, State; State=Out ; NL= NW = NC =0; wh
Practice 1-8 Write a program that counts the number of spaces, tabs, and line breaks.The code is as follows:#include //contains information about the standard library. intMain ()//defines a function named Main, which does not accept parameter values. {printf ("====== counts the number of spaces, tabs, and line breaks in the characters entered ======\n"); //characters entered, space-space Counter, tab counter, line break counter. intC, SL, TL, NL; SL= TL = NL =0; while((
. for(row =0; Row ) { if(GetLength (Cs[row]) >Ten) {printf ("%s\n", Cs[row]); }} getchar (); //prevent the console from flashing through, you need to accept any characters after you close the console. return 0;//returns a shape to the execution environment, and 0 represents a successful execution. }//gets the length of each line. intGetLength (Charcs[]) { inti =0; while(cs[i++]! =' /') ; returni;}Personal Understanding:Limit the maximum number of rows to support 10 line
Practice 1-16 Modify the main program of the program that prints the longest line of text, main, so that it can print the length of any length of input lines and print as much text as possible.The code is as follows:#include //contains information about the standard library. #defineMAXLINE 10intGetlineCharLine[],intmaxline);intMain ()//defines a function named Main, which does not accept parameter values. { intLen; intMax; CharLine[maxline]; while(max = Getline (line, MAXLINE)) >0) {printf (
Linux C Programming series exercises system call file IO, memory ing program write ls program, the system calls ls
Click Connect to enter the article
1.1Linux System Call exercise
1.2 simulate Linux ls program to display the tree directory
1.3 Memory sharing for simple data sharing
Linux C development is not a
1. invalid: 6_05 (cannot begin with a number)
A $ ($ is an invalid symbol ).
2. mybook (openbook, closebook, readbook, takebook, putbook ).
3. [mybook takebook];
[Mybook openbook];
[Mybook readbook];
[Mybook closebook];
[Mybook putbook];
4. [myboat driver];
[Mymotorcycle driver];
[Mycar driver];
Overlap.
5. Ease and reduce the memory (I understand that the question is not too clear ).
6. Understand the advantages and disadvantages of Procedural language and object-oriented language.
7.
// ------
methods are based on a single unit of code. Object-oriented programming methods allow objects to be independent.
(4) One-time use and reusable comparison
Depending on the implementation, the structured process may not be reused. and an object-oriented approach, an object is a modular unit. Has a complete entity, so it can be highly reusable.
(5) Comparison of ordered algorithm and unordered algorithm
A structured
Practice 1-1 running the "Hello, World" program in your own system. Then deliberately remove part of the program, to see what error messages will be obtained.The code is as follows:#include // contains information about the standard library. int main () // defines a function named Main, which does not accept parameter values. { printf ("Hello, world\n"); // The man function calls the library function printf to display a sequence of characters. getch (); // Prevent t
Exercise 1-15 Rewrite the temperature conversion program in section 1.2 and use the function to achieve temperature conversion calculations.The code is as follows:#include //contains information about the standard library. floatFahrtocelsius (floatFahr);floatCelsiustofahr (floatCelsius);intMain ()//defines a function named Main, which does not accept parameter values. {printf ("1 degrees Fahrenheit is equal to%.1f degrees Celsius .", Fahrtocelsius (1)); printf ("\ n"); printf ("1 degrees Celsius
Practice 1-6 Verify that the value of the expression GetChar ()! = EOF is 0 or 1.The code is as follows:#include //contains information about the standard library. intMain ()//defines a function named Main, which does not accept parameter values. { //Verify that the value of GetChar ()! = EOF is 0 or 1. printf"Verify that the value of GetChar ()! = EOF is 0 or 1. \ n"); printf ("the validation is complete and the result is%d. \ n", GetChar ()! =EOF); Getch (); //prevent the console from fl
(fname, fn);} void Person: Show () const {cout
10.3 compile the golf class, including the name and Score data, and call
// 10.3 write the golf class, including the name and Score data, and call # include
# Include
Using namespace std; const int Len = 40; class golf {string fullname; int handicap; public: golf (): fullname ("no"), handicap (0) {} golf (const char * name, int hc) {fullname = name; handicap = hc;} void showgolf () {cout
10.4 perform
Programming | network
1. What are the types of data that C # supports? What are the features compared to C + +?
Troubleshooting
The data types supported by C # are:
(1) Value type
Includes: Simple type, struct type, enum type. Among them, the simple type is divided into: integral type, Boolean type, character type, f
Programming | network
1. c/s structure model and b/s structure of the main difference is what?
Troubleshooting
First, on the performance side of the system. As long as you have Internet browser, you can use the B/s system. However, the B/s structure of the client can only complete browsing, query, data entry and other simple functions, most of the work to be borne by the server, which put forward a very h
Programming | network
1. Fill in the blanks
1 attributes that enable the control to respond to user interaction are enabled.
2 The property that controls whether the control displays is Visible.
3 If you want to enter a password in the text box, you often specify the PasswordChar property.
4 If the value of a CheckState property is indeterminate at a certain time, the value of its property checked is Unchecked.
5 using a Panel or GroupBox control, y
related to the creation, access, and write operations of the directory.
For example, the CreateDirectory method is used to create all directories in the specified path, and the Delete method deletes the specified directory; The Move method enables renaming or moving the directory; The Exists method is used to determine whether a given path references an existing directory on disk; The GetCurrentDirectory method is used to get the current working directory of the Application; The GetFiles method
Java programming Chapter 1 programming exercises and java programming exercises
2.1
public class test { public static void main(String[] args) { Scanner input = new Scanner(System.in); double f, c;
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.