The invention discloses an automatic programming method and system for natural language machine thinking. After a task book is obtained, the following steps are sequentially carried out: S1, converting and expressing a task book text; S2, establishing a corresponding relation library; S3, externally inputting or automatically compiling a task book text, and interpreting, defining and understandingthe task book to be solved; S4, searching an algorithm module library according to the problem type and the problem framework composition mode, and designing an algorithm for solving the problem, a design program and a selected algorithm according to the algorithm module library; S5, entering a natural language generation type system, and outputting an instruction to enter programming software orenter any programming language for programming to obtain a program; And S6, running the program, and checking an output result of the program. Therefore, the machine automatically generates a specific program capable of completing the target after receiving the demand description about the target to be realized by the designed program. The method is a creative artificial intelligence technology,and has a great commercial value.