hello world程序

来源:互联网 发布:爱思唯尔数据库英文 编辑:程序博客网 时间:2024/05/29 02:46
一、VS.net2005的下的C++
//标准输出
#include <tchar.h>
#include <iostream>


int _tmain(int argc, _TCHAR* argv[])
{
std::cout<<"hello world"<<std::endl;
return 0;
}


//文件输出
#include <tchar.h>
#include <fstream>
#include <iostream>


using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
char t[30];
ofstream fo("c://123.txt");
fo<<"hello world"<<endl;
fo.close();


ifstream fi("c://123.txt");
while(!fi.eof())
{
fi>>t;
cout<<t<<' ';
}
fi.close();


return 0;
}


三、C#
//标准输出
//Program.cs
using System;


namespace ConsoleApplication1
{
    class Program2
    {
        static void Main(string[] args)
        {
            System.Console.Out.WriteLine("hello world");
        }
    }
}


四、Java
//标准输出
//Program.java
import java.io.*;


class Program{
static void main (String[] args){
System.out.println("helloworld");
}
}



原创粉丝点击