**VC++6.0 win32 控制台应用程序 简单应用 附代码 **
.cpp 文件名
注意:在源文件添加如下声明:
#include //没有.h
using namespace std;//使用std名字空间,用来输入输出
HELLO WORLD
// zxy1.cpp : 定义控制台应用程序的入口点。
#include "stdafx.h"
#include<iostream>
#include<math.h>
int _tmain(int argc, _TCHAR* argv[])
{
std::cout<<"HELLO world!!\n";
return 0;
}
解函数
#include<iostream>
#include<math.h>
using namespace std;
const double ANG_TO_RAD = 0.0174532925;
class angle
{
double value;
public:
void SetValue(double);
double GetSine(void);
}deg;
void angle::SetValue(double a)
{
value = a;
}
double angle::GetSine(void)
{
double temp;
temp = sin(ANG_TO_RAD* value);
return temp;
}
void main()
{
deg.SetValue(60.0);
cout << "The sine of the angle is:";
cout << deg.GetSine() << endl;
}