C language blog job I work 06

This work belongs to the curriculum C Programming Language II
Where the job requires https://edu.cnblogs.com/campus/zswxy/CST2019-3/homework/9887
My aim in this course is Good writing programs, to improve their accuracy and speed
This job helped me achieve that goal in terms of specific By code on the PTA let me find a job and continue to correct their mistakes
references C language programming, CSDN community programming

A, PTA lab assignments

My rankings

1.1 Output leap year

  • All output in the 21st century leap year since a year cutoff year. Note: Criterion leap year is the year of the year divisible by 4 but not divisible by 100, or divisible by 400

    1.1.1 Data Processing

  • Data are expressed: the variable "sum, n"; where the variable value "assignment operation, an arithmetic operation"; variable type "sum, n is (int) integer variable"
  • Data Processing: The expression "sum + = (n% 10) * (n% 10), n / = 10"; flow structure "branch structure"

    1.1.2 Screenshot experiment code

    1.1.3 build test data

    Entry Export Explanation
    2010 2004 2008 The year is a leap year
    2048 2004 2008 2012 2016 2020 2024 2028 2032 2036 2040 2044 2048 Over the years a leap year
    2059 2004 2008 2012 2016 2020 2024 2028 2032 2036 2040 2044 2048 2052 2056 Over the years a leap year

    1.1.4PTA and submit a list of

    [](https://img2018.cnblogs.com/blog/1813252/201911/1813252-20191101231856922-123508245.png
  • 1. The right part: after the function defined error added semicolon
  • 2. partially correct: the definition of a variable number of time-division forget to play
  • 3. partially correct: the equal sign written assignment symbol
  • 4. partially correct: the main function without adding return instruction

    2.1 daffodils JUDGMENT

  • This problem required to achieve a function, it is determined whether any integer number daffodils (three digits must be equal on every digit number and the number itself and cubic). E.g. 153 + 5 = 1 ^ 3 ^ 3 ^ 3 + 3 + 1 = 125 + 27 = 153, and 1 155 or not narcissistic number. If the number of daffodils, the function returns 1, otherwise it returns 0.

    2.1.1 Data Processing

  • Data are expressed: the variable "i, j, k, N"; the value of the variable source "assignment operation, an arithmetic operation"; Variable Type "is an integer variable"
  • Data Processing: The expression "i = N / 100, j = N / 10% 10, k = N% 10"; process type "branch"
  • Function parameters: int main () function is the main tune; int func (const int N) of the called function; argument "N", the parameter type "integer variable"; parameter "N", the parameter type "integer variable "

    2.1.2 Screenshot experiment code

    2.1.3 build test data

    Entry Export Explanation
    256 return 0 256 is not a narcissistic number
    721 return 0 721 is not a narcissistic number
    401 return 1 401 is the number of daffodils

    2.1.4PTA submit a list and description

  • 1. Compile Error: There is less of a semicolon assignment operator
  • 2. partially correct: There should be some test data is not in the program

    Second, the code peer review

    Classmate Code

    My code

  • 1. In the definition of the function of the determination of the students are determined to be the p-cycle is then performed during the determination, and I was determined during the first cycle, compare the student can be found more easily interpret code
  • 2. Define the function of the conditions of the students fof loop set and I are not the same, so back to judge the conditions are not the same

    Code 2 students

    My code

  • 1. The students represent a direct step number of each of the cube and I are calculated separately, compare with the students under the code more concise
  • 2. The students first calculate the sum of the individual Cube In making this judgment, I directly to each cube with the number of judges and put together, so make the code more readable

    Third, learning summary

    3.1 learning progress bar

    Week / Date This week the time spent Lines of code Introduction learned point Currently more confused issues
    6/27-6/31 24 hours Line 91 Custom function and call the function operate on mathematical functions Somewhat less clear points and parameter arguments

    3.2 cumulative number of lines of code and blog

    3.3 Summary and perception of learning content

  • 3.3.1 learning content summary
  • 3.3.2 Learning Experience
  • With this week's study, found himself a lot of questions, the first is the teacher talked about things not remember very clearly miss some detail and new content; the second is to some errors still do not know what it meant, and then in the PTA there will be some in scanf, return no error warning statement like, what is this I do not know to express. But I also found this in the PTA to do with a lot less space and do not hit the space problem, there is a semicolon accustomed to fight at the end of the statement.

Guess you like

Origin www.cnblogs.com/zzx123-/p/11780206.html