输入一个实数,用数学函数计算
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 00:46:14
这个题不难呀?怎么没人答?不用pow函数,那就自己写个for循环呀.就是不知道你要求什么语言了,你也不说清楚,C和C++都写了,C语言:#includevoidmain(){inty,i;double
这要看hs的定义:如果hs的定义容许用向量做参数,直接带入即可,如a2=sin(a1);如果hs的参数只能是单个数,得用循环:n=500;a2=zeros(1,n);(生成一个元素全为0的向量a2)f
l,kpki[p',k0yhj0';l-p;'.piklp';
#includeusingnamespacestd;main(){doublex,y;cout
#includemain(){\x05intm,n;\x05ints=1;\x05intpower(inta,intb);\x05printf("inputmn(m^n):\n");\x05scanf
doublemax(doublea,doubleb,doublec){doublem;if(a>b)m=a;elsem=b;if(c>m)m=c;returnm;}
#include#includeintmain(){doubled;scanf("%lf",&d);printf("|y|=%.2lf\n",fabs(d));return0;}
#include#include#defineE2.7182voidmain(void){floatx;floaty;scanf("%d",&x);if(x>=-1)y=pow(x,2)+1;
#include//希望对您有用#includeintmain(){intx,y;printf("Pleaseenterthenumber:");scanf("%d",&x);if(x
#includefloatx;intn,i;floats=1.0;voidmain(){printf("PleaseInputx:");scanf("%f",&x);printf("PleaseInp
#include <iostream>using namespace std ;int main(){
voidmain(){floatx,y;cin>>x;if(x=10)y=3*x-11;elsey=2*x-1;cout
#include"stdio.h"#include"math.h"voidmain(){doublex,y,sinValue,eValue;printf("PleaseInputTheValueOfX
要写出递推式:f(x,n)=1+x*f(x,n-1)doublef(doublex,intn){if(n==0)return(1.0);elsereturn(1.0+x*f(x,n-1));}
用循环.再问:求过程?再答:再答:图片看的清么,刚刚编的,望采纳。再问:还行,我在编译一遍试试再答:嗯,我调试过了,能成功。你再看看吧。再问:有了一点思路,
自带函数mean.还需要自己写函数么?如果是你就把mean函数调出来看看,然后简化一下就可以了.
MATLAB或LINGO
#include#include#includeusingnamespacestd;intmain(){doublen;cin>>n;cout