新年祝福
新年到,喜庆欢乐围绕。
@程序员小助手用 24 种编程语言,
祝福大家 “新年快乐”,“大吉大利”!
1 - C
#include<stdio.h> intmain(){ printf("Happy new year!"); return1; }
2 - Java
publicclassHappyNewYear{ publicstaticvoidmain(String[] args){ System.out.println("Happy new year!"); } }
3 - C++
#include<iostream> #include<stdio.h> intmain(){ printf("Happy new year!n"); puts("Happy new year!"); std::cout<< "Happy new year!"<< std::endl; return1; }
4 - Python
# Python 2print'Happy new year!'# Python 3print('Happy new year!')
5 - C#
usingSystem; classHappyNewYearApp{publicstaticvoidMain(){ Console.WriteLine("Happy new year!"); Console.ReadKey(); } }
6 - PHP
echo'Happy new year!'; print('Happy new year!') print_r('Happy new year!'); var_dump('Happy new year');;
7 - JavaScript
# 浏览器console.log('Happy new year!') # node.jsvar sys = require("sys") sys.puts("Happy new year!")
8 - Ruby
print"Happy new year!n"puts "Happy new year!n"
9 - R
print("Happy new year!")
10 - SQL
-- 创建表CREATETABLEINFO (TEXTVARCHAR(50)); -- 插入数据 INSERTINTOINFO (TEXT) VALUES('Happy new year!'); -- 查询值 SELECTTEXTFROMINFO; -- 删除表DROPTABLEINFO;
11 - Perl
print"happy new year!";
12 - VB
ModuleHappyNewYear SubMain() MsgBox("Happynew year!")EndSub EndModule
13 - Scala
objectHappyNewYear{ defmain(args:Array[String]) { println("Happy new year!"); } }
14 - Shell [Bash]
echo"Happy new year!"
15 - Fortran
program happy_new_year print*,"Happy new year!"endprogram happy_new_year
16 - TCL
puts"Happy new year!"
17 - AWK
awk'BEGIN {print "Happy new year!"}'
18 - Swift
println("Happy new year!")
19 - Pascal
ProgramHelloWorld(output); beginwriteln('Happy new year!') end.
20 - Ada
withTEXT_IO; procedure HelloNewYear is beginTEXT_IO.PUT_LINE ("Happy new year!"); endHelloNewYear;
21 - Go
packagemain import"fmt"funcmain(){ fmt.Println("Happy new year!") }
22 - COBOL
IDENTIFICATIONDIVISION.PROGRAM-ID.'HAPPYNEWYEAR'.ENVIRONMENTDIVISION.DATADIVISION.FILESECTION.WORKING-STORAGESECTION.PROCEDUREDIVISION.MAIN-PROCEDURE.DISPLAY"Happy new year!"STOPRUN.
23 - MATLAB
functionHappyNewYear()disp('Happy new year!'); end
24 - HTML
<!DOCTYPE html><html><body><p>Happy new year!</p></body></html>
写在最后
【HTML】:“位居 24 强之列,我名副其实”。
其他语言一脸无法描述之状态。
MARKDOWN 墙裂表示不服!
希望广大的读者,在新年喜悦之余,
能够看到自己夜以继日相伴的编程语言
为自己送上 “Happy new year”,
应心甚宽慰。