#include <stdio.h> int main() { printf("Happy new year!"); return 1; } 2 - Java
public class HappyNewYear { public static void main(String[] args) { System.out.println("Happy new year!"); } } 3 - C++
#include <iostream> #include <stdio.h> int main() { printf("Happy new year!\n"); puts("Happy new year!"); std::cout << "Happy new year!" << std::endl; return 1; } 4 - Python
# Python 2print 'Happy new year!'# Python 3print('Happy new year!')5 - C#
using System; class HappyNewYearApp { public static void Main() { 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
-- 创建表CREATE TABLE INFO (TEXT VARCHAR(50)); -- 插入数据 INSERT INTO INFO (TEXT) VALUES ('Happy new year!'); -- 查询值 SELECT TEXT FROM INFO; -- 删除表DROP TABLE INFO; 11 - Perl
print "happy new year!";12 - VB
Module HappyNewYear Sub Main() MsgBox("Happy new year!") End Sub End Module 13 - Scala