Hello World!

409 阅读1分钟

第一篇文章 Hellod World

//C

#include<stdio.h>

int main(void)
{
  printf("Hello world!");
  return 0;
}

//C++

#include <iostream>
using namespace std;

int main()
{
    cout <<"Hello World!"<< endl;
    return 0;
}

//Java

class HelloWorld
{
  public static void main(String[] args)
  {
    System.out.println("Hello World!!");
  }
}

//HTML

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Hello World!</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
    <h1>Hello World!</h1>
</body>
</html>

//C#

using System;

namespace helloWorld
{
    class HelloWorld
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

//GO

package main

import (
	"fmt"
)

func main() {
	fmt.Println("Hello World")
}

//JavaScript //TypeScript

console.log("Hello World");

//lua //swift

print("Hello World") 

//python

print('Hello World')

//PHP

<?php
  // In PHP, we use echo to print text
  echo "Hello World";
  // If you want to print in browser's console, we use print_r
  print_r("Hello World");
  // if you want the variable data types as well use var_dump
  $stringVar = 'hello world';
  var_dump($stringVar);
?>

//R

variable <- "Hello World"
print (variable)

//Fortran

PRINT *, "Hello World!" 
END

//Ruby

puts 'Hello World'

//Scala

object HelloWorld extends App { 
   println("Hello, World!") 
}

//F#

open System
printfn "Hello, World!"

//CoffeeScript

alert "Hello, World!"

//D

import std.stdio;

void main()
{
    writeln("Hello World");
}

//Basic

10 PRINT "Hello, World!"
20 END

//汇编


.model small
.data
        msg db 10d,13d,"Hello World$"

.code
        mov ax,@data
        mov ds,ax
                                        
        lea dx,msg                      
        mov ah,09h                      
        int 21h                         

        mov ah,4ch                      
        int 21h                         
end

//Haskell

main = putStrLn "Hello, World!"

//Shell

echo "Hello World"

//Batch

@echo off 

echo Hello World

第一篇文章 hello world 一下