多样化题解
2025-08-06 09:29:43
发布于:江苏
134阅读
0回复
0点赞
C:
#include<stdio.h>
int main(){
    printf("Hello world");
    return 0;
}
C++:
1.cout输出
#include<iostream>
using namespace std;
int main(){
    cout<<"Hello world";
    return 0;
}
2.printf打印
#include<iostream>
using namespace std;
int main(){
    printf("Hello world"); 
    return 0;
}
3.puts直接版
#include<iostream>
using namespace std;
int main(){
    puts("Hello world"); 
    return 0;
}
4.puts拼接版
#include<iostream>
using namespace std;
int main(){
    puts(“Hello" " " "world");
    return 0;
}
5.string 有点多此一举
#include<iostream>
#include<cstring>
using namespace std;
int main(){
    string s="Hello world";
    cout<<s;
    return 0;
}
Java:
public class Main{
    public static void main(String[] args) {
        System.out.println("Hello world");
    }
}
Pascal:
begin
    writeln('Hello world');
end.
Python2:
print "Hello world"
Python3:
print("Hello world")
JavaScript:
console.log("Hello world")
PHP:
<?php
echo 'Hello World';
?>
C#Mono:
    using System;
namespace helloWorld
{
    class HelloWorld
    {
        static void Main(String[] args)
        {
            Console.WriteLine("Hello world");
        }
    }
}
Visual Basic:
    subsub main
msgbox "Hello world"
end sub
}
R:
cat("Hello world")
Go:
    package main
import "fmt"
func main() {
    fmt.Println("Hello world")
}
全部评论 3
闲的呀
2024-05-05 来自 北京
1你咋知道的???
2024-05-25 来自 江苏
0?
2025-10-13 来自 浙江
0
6
2025-05-11 来自 广东
0不过确实挺全
2024-05-05 来自 北京
0











有帮助,赞一个