码迷,mamicode.com
首页 > 其他好文 > 详细

1.hello world

时间:2015-07-19 13:11:56      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:

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"

1.hello world

标签:

原文地址:http://www.cnblogs.com/jiu0821/p/4658462.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!