如题

解决方案 »

  1.   

    在file->new里面选择console Application不是就能够编写控制台程序了吗。输出用因该是pringf
      

  2.   

    The program below is a simple console application that you can compile and run from the command prompt.program Greeting;{$APPTYPE CONSOLE}var MyMessage: string;begin
      MyMessage := 'Hello world!';
      Writeln(MyMessage);
    end.The first line declares a program called Greeting. The {$APPTYPE CONSOLE} directive tells the compiler that this is a console application, to be run from the command line. The next line declares a variable called MyMessage, which holds a string. (Delphi has genuine string data types.) The program then assigns the string "Hello world!" to the variable MyMessage, and sends the contents of MyMessage to the standard output using the Writeln procedure. (Writeln is defined implicitly in the System unit, which the compiler automatically includes in every application.)You can type this program into a file called Greeting.pas or Greeting.dpr and compile it by enteringDCC32 Greetingon a Windows-based system, ordcc Greetingon a Linux-based system. The resulting executable prints the message "Hello world!"