//求i*i+1/i所有加起来的值 #includeint main(void){ int m,n; double i,y; y=1; printf("输入m,n的值:"); scanf("%d%d",&m,&n); for(i=m;i<=n;i++){ y=y+(i*i+1/i); } printf("y=%Lf",y); return 0;}
本文共 281 字,大约阅读时间需要 1 分钟。
//求i*i+1/i所有加起来的值 #includeint main(void){ int m,n; double i,y; y=1; printf("输入m,n的值:"); scanf("%d%d",&m,&n); for(i=m;i<=n;i++){ y=y+(i*i+1/i); } printf("y=%Lf",y); return 0;}
转载于:https://www.cnblogs.com/xuqiongxiang/p/3378024.html