In the first chapter of "Boulevard to Jane", Mr. Greatlypraised quoted a parable of "Yugong Yishan", which leads to the fundamental of programming: order, selection and circulation. The project of "Yugong Yishan" is huge, but it can be accomplished by the extremely simple. Some of the people around me once said, "I was born without programming." If they looked at Mr. Zhou's book and did not know that he would not think so, Mr. Zhou in the "will or do not write a program problem" to give his own view: In addition to the congenital retarded or late lazy, will write the program. A few pseudo-codes are used to present some of the questions Mr. Greatlypraised mentioned in the first chapter.
Pseudo code one: Yugong Yishan
public class Yugong Yishan
{
public static void Main (string[] args)
{
while (mountain not flat)
{
If (the foolish not to die | | Though a foolish man dies, he has a son.
Buckle stone Ken Soil, Ji Hod transported in the tail of the Bohai Sea;
Else
Break
}
System.out.println ("The mountain has been flat, the road through the south of Henan, up to Hanyin." ”)
}
}
Pseudo code two: whether the program will write a problem
public class Write Program
{
public static void Main (string[] args)
{
If (you are not a congenital retarded | | You are not the day after tomorrow lazy person
System.out.println ("You will compile the program.") ”);
Else
SYSTEM.OUT.PRINTLN ("You won't make up the program.") ”);
If (you know, if you get up in the morning, if it's cold, then you can wash your clothes && hot days and then && day after day until death)
If (you know that you can skip the day if you are sick, unable to act, emergency)
System.out.println ("You will be programmed and can evolve to the designer.") ”);
}
}
Pseudo code Three: program = algorithm + structure
public class programming
{
public static void Main (string[] args)
{
if (you have analyzed the matter clearly)
Start coding;
Else
SYSTEM.OUT.PRINTLN ("Programming fails, the computer doesn't know what you want to do.") ”);
}
}
Pseudo code four: language
public class language
{
public static void Main (string[] args)
{
If (you are familiar with a language)
You can master and start programming within two weeks;
}
}
The first chapter of "Boulevard to Jane". Java pseudo-code