-
The Pascal compilation system is a programming language. It was designed and founded in the late sixties by Professor Niklaus Wirth of Switzerland. Pascal is the first structured programming language with rigorous syntax, clear hierarchy, easy to write and readable programs.
Pascal language is widely used in various software, and the program is divided into name (self-proposed after program), setting (defined after var), start (begin), program (body), read (read read ln), and end (end), with strong structural hierarchy, rigorous and tight.
It has rich data types and concise and flexible operation statements. Pascal is an important milestone in the development of high-level languages. The Pascal language was the first language to systematically embody and define the concept of structured programming.
-
LZ should be a beginner pascal, give some advice to the landlord:
For beginners, the most valuable thing is that these small problems can be thought and solved independently, and then feel the fun of solving problems independently, so it greatly increases the confidence of learning, which is very important for the motivation of future learning.
This kind of similar problem is generally explained to you, and the other problems are solved independently, and LZ must pay attention to learning the solution to the problem rather than learning the answer to this question.
Don't hide it from the landlord, I did the first two questions (1) and (4) when I was a beginner, and I solved it independently at that time, and I thought about it for a long time before I made it.
Let me get started.
1.This kind of topic generally needs to go through the following process: find out the law of change, summarize the law.
Let's start with small examples.
n=2***
n=3***
The law is actually obvious, n represents the number of lines output, and then the spaces between the *** of different lines are different.
Then let's go further and summarize: in general, each row is made up of four parts: space, space, space, space
We only need to grasp the relationship between the number of two spaces and the ith line and n.
It is clear that the number of spaces in the first part is 0, 1, 2, 3, 4 ......
The second part of the whitespace is a little more difficult, but the easiest way to start with is 1 in line n, 3 in line n-1, and 5 ......... in line n-2
From this, we conclude that the number of lines i is 2*(n-i)+1
At this point, it is not difficult to write the program:
for i:=1 to n do
beginfor j:=1 to i-1 do write(' ');The first part of the space is output, which is i-1 space.
write('***');
for j:=1 to 2*(n-i)+1 do write(' ');The second part of the space is output, which is 2*(n-i)+1 space.
write('***');
end;The last three questions,LZ solve it yourself.,It's very good for LZ to make it.,If you really don't ask me again.。
I'm embarrassed to be called by Mr. Zhao, I can't afford it, I'm sorry I can't help you with the questions you asked!
One b, because the world has just been decided, and the king with the same surname can consolidate his rule. >>>More
First. Solution: Because a(n+1)=a(n)+1 (n(n+1)), so a(n+1)-a(n)=1 (n(n+1)) so a(n)-a(n-1)=1 (n(n-1))a(n-1)-a(n-2)=1 ((n-1)(n-2))a(2)-a(1)=1 (2*1). >>>More
You don't know anything about lawyers?! Want to be a lawyer? >>>More
There is a jumper on the hard disk, if there is no jumper, the interrupt conflict of the two hard disks can not be recognized by the system, if the old hard disk is an IDE interface, you just need to put the hard disk flat, the jumper part across the two rows of pins The first jumper can be unplugged.