从零开始学习Ada(尝试)

with text_io;
use text_io;

procedure helloworld is

   task Foo;

   task body Foo is
   begin
      Put("In foo");
      New_Line;
   end Foo;

begin
   Put("Hello World"); 
   New_Line;



end helloworld;

Ada有一个特性叫Concurrency,并行执行task,先后顺序未定。所以对于上面的procedure,可能会出现两种结果:

In fooHello World

In foo
Hello World






  • Put相当于cout
  • New_Line就是开新的一行

你可能感兴趣的:(C++)