title:编写程序,输出字符串“hello world!“。
notice:
1.以后所有的程序,运行结束时都要另输出个回车换行。
2.以后所有的程序,主函数main的类型定为int。
answer by C:
1 #include <stdio.h> 2 3 int main(){ 4 puts("hello world!"); 5 return 0; 6 }
1 #include <stdio.h> 2 3 int main(){ 4 printf("hello world!\n"); 5 return 0; 6 }
answer by C++:
1 #include <iostream> 2 3 using namespace std; 4 5 int main(){ 6 cout<<"hello world!"<<endl; 7 return 0; 8 }
answer by java:
1 /* 2 * To change this template, choose Tools | Templates 3 * and open the template in the editor. 4 */ 5 package jiu; 6 7 /** 8 * 9 * @author jiu 10 */ 11 public class Jiu { 12 13 /** 14 * @param args the command line arguments 15 */ 16 public static void main(String[] args) { 17 // TODO code application logic here 18 System.out.println("hello world!"); 19 } 20 }
answer by python 2.7:
1 print "hello world!\n"
时间: 2024-12-09 07:51:59