热门

最新

红包

立Flag

投票

同城

我的

发布
m0_62127062
sweet strawberry
5 年前
truem0_62127062

坚持每日打卡。https://dailycode.csdn.net/

每日一练
CSDN App 扫码分享
分享
评论
2
打赏
  • 复制链接
  • 举报
下一条:
#include<stdio.h> #include<math.h> #include<stdlib.h> int main() { double a,b,c,r,x0=-10,y0=10; double x1,y1; double min=999; int nlter; printf("输入abc的值:"); scanf_s("%lf %lf %lf",&a,&b,&c); printf("输入学习率:"); scanf_s("%lf",&r); for(nlter=0;nlter<30;nlter++) { x1=x0-(r*((2*a*x0)-b)); y1=(a*x0*x0)+(b*x0)+c; x0=x1; y0=y1; } printf("x=%lf,min=%lf\n",x0,y0); system("pause"); }
立即登录