C Language Blog Job--function

Source: Internet
Author: User
Tags arithmetic operators logical operators

I. PTA experiment 6-1 symbolic function 1. PTA Submission List

2. Design Ideas

3: Problem debugging process encountered problems and PTA submission List situation description.
    • The preceding error is caused by = = in the relational operator
6-6 using functions to output Daffodils number 1. PTA Submission List

2. Design Ideas
    • 1.narcissistich function (determine if number is narcissus)
      Define the loop variable I,j,a store the number on each one, sum sum count number of digits
      for (I=NUMBER;I>0;I=I/10) count+1 per execution
      for (k=1;k<=count;k++) q=q*a to get each bit of n-time (n is the number of digits) sun=sun+q,q=1
      Returns 0 if Sum==number returns 1
    • 2.PrintN function (print the number of daffodils in the open interval (m, n)
      Define R to store numbers
      for (r=m+1;r<=n-1;r++) calls the narcissistic function and prints the number if it returns 1
3: Problem debugging process encountered problems and PTA submission List situation description.
    • Partly correct: When printing daffodils number, the loop often judges a result that sometimes outputs an error, which is corrected by variable monitoring
    • Compile error: Void function cannot have return value
7-1 number of combinations 1. PTA Submission List

2. Design Ideas

3. Problems encountered in commissioning process and PTA submission List status note
    • Partially correct: No consideration of the N=M/2 situation in the PTA test point to find the error
Second, peer code pairs of peer review 1. My Code, mutual evaluation of student code

Li Yucheng Code:
My Code:

2. Where do I differ from my classmates ' code? What are the advantages? What style of code do you prefer? If the classmate code is wrong, please help to point out where the problem.
    • The difference in his first function variable name is not easy to understand, and I am better than him, the second paragraph of the function he is to divide the number of two to solve and I am only the previous 1 as a special case my loop is used for (;;) It's not understood enough, so he's going to be better, but I think my code layout is pretty and concise.
Third, this week's topic set PTA Final Ranking


Iv. Study Summary of the Week 1. What did you learn? What data types are 1.1 C languages?
    • Plastic
    • Short shaping
    • Long Plastic
    • No-sign shaping
    • unsigned long shaping
    • unsigned short shaping
    • Character type
    • Single-precision double-precision floating-point type
1.2 Character type data need to be aware of the place?
    • Uppercase and lowercase conversions can be used-' a ' + ' a '
    • The character variant is turned into an ASC code
1.3 Self-increment decrement operator
    • a--/a++ is the suffix (self-decrement) increment, the value of the variable (decrease) increases, the expression value is unchanged
    • --a/++a is the prefix (self-decrement) increment, the value of the variable (decrease) increases, and the expression value increases
1.4 Operator Precedence?
    • Elementary Operators > Single-mesh Operators > Arithmetic operators > Shift operators > Relational operators > Bitwise logical operators > Logical operators > Three mesh Operators > Assignment operators > Comma operators
    • Only the monocular operator and the assignment operator are combined from left to right
1.5 which expressions are in C language? What do you do wrong in class, please analyze the reason here?
    • Assignment expressions, logical expressions, conditional expressions, relational expressions
    • The wrong question at the time did not know the suffix increment does not change the expression, now understand
2. This week's content, you are not what?
    • It's basically all figured out.
3. Circular structure Examination Summary 1. What is wrong and how to change it?
    • That's right
2. is the exam result satisfactory, how to improve?
    • The last question code is a bit complicated, mainly is the idea is not clear enough, after doing the problem more write pseudo-code

C Language Blog Job--function

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.