
PHP
<?php
echo 'Hello World.';
?>
Java
package com.example;
public class Main {public static void main(String[] args) {System.out.println("Hello World.");
}
}
Python
print("Hello World.")
Vue
<template>
<div id="app">
<h1>{{msg}}</h1>
</div>
</template>
<script>
export default {name: 'HelloWorld',
data () {return {msg: 'Welcome to Your Vue.js App'
}
}
}
</script>
Javascript
console.log("Hello World.");
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World.</title>
</head>
<body>
<h1>Hello World.</h1>
</body>
</html>
C
#include <stdio.h>
int main() {printf("Hello World.");
return 0;
}
C++
#include <iostream>
int main() {std::cout << "Hello World." << std::endl;
return 0;
}
Go
package main
import "fmt"
func main() {fmt.Println("Hello World.")
}
Rust
fn main() {println!("Hello World.");
}
Ruby
puts "Hello World."
Swift
print("Hello World.")
bash
echo "Hello World."
PowerShell
Write-Host "Hello World."
Kotlin
fun main() {println("Hello World.")
}
Dart
void main() {
print("Hello World.");
}
正文完