首页 » 排名链接 » hello world:15种开发语言的写法(写法程序员语言开发考研)

hello world:15种开发语言的写法(写法程序员语言开发考研)

雨夜梧桐 2024-11-23 10:15:34 0

扫一扫用手机浏览

文章目录 [+]

01、PHP

echo “hello world ”;

02、C

#include <stdio.h>int main(void){ printf("Hello World!\n");}

03、C++

hello world:15种开发语言的写法(写法程序员语言开发考研) 排名链接
(图片来自网络侵删)

#include<iostream>using namespace std;int main(){cout << "hello world!"<< endl;return 0;}

04、C#

using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace HelloWorld{ class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); Console.ReadLine(); } }}

05、Python

print('Hello World!')

06、GO

package mainimport "fmt"func main() {fmt.Printf("Hello, world.\n")}

07、JAVA

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

08、asp.net

using System;using System.Collections.Generic;using System.ComponentModel;using System.Linq;using System.Text;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace Controls{ public class RenderHelloWorld : Control { protected override void Render(HtmlTextWriter writer) { writer.Write("Hello World"); } }}

09、JSP

<% out.println("HelloWorld"); %>

10、JavaScript

<script type="text/javascript" charset="utf-8"> window.alert("Hello World");</script>

11、Lua

print("hello world")

12、Perl

perl -e 'print "hello world \n"'

13、Buby

puts "Hello World!"

14、Visual Basic

新建工程——>标准EXE——>打开工程1-Form1——>创建控件Label1——>点击F7弹出代码窗口——>选择Form的Load事件,写入以下代码:

Private Sub Form_Load()Label1.Caption = "Helloworld"End Sub

保存完之后,再选择,文件——>生成工程1.exe——>选择工具栏上的播放按钮,则得到如下的结果:

15、汇编语言

;文件名Hello.asmDSEG SEGMENTMESS DB 'Hello,World!' ,0DH,0AH,24HDSEG ENDSSSEG SEGMENT PARA STACK DW 256 DUP(?)SSEG ENDSCSEG SEGMENT ASSUME CS:CSEG,DS:DSEGBEGIN: MOV AX,DSEG MOV DS,AX MOV DX,OFFSET MESS MOV AH,9 INT 21H MOV AH,4CH INT 21HCSEG ENDS END BEGIN

源文件Hello.asm——>目标文件Hello.obj——>可执行文件Hello.exe

本文图片来自网络,如有侵权请联系删除!

#程序员# #程序员那些事#

——END——

标签:

相关文章