
vc++6.0中编写S=sin(x)的程序,怎么写?
展开全部
//#include "stdafx.h"//In VC++6.0, with this line, please...
#include <iostream>
#include "math.h"
using namespace std;
int main(void){
double x,y;
cout << "Input x(R:)...\nn=";
cin >> x;
y = x<0 ? 3*x*x-5/x : 0<=x && x<5 ? 1/(2+cos(x)) : sqrt(sin(x)+1);
cout << "y(" << x << ") = " << y << endl;
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询