程序填空
/*-------------------------------------------------------
【程序填空】
---------------------------------------------------------
功能:計算并輸出500以內(nèi)最大的10個能被13或17整除的自然數(shù)之和。
-------------------------------------------------------*/
#include "stdio.h"
/***********FILL***********/
int fun(__int k___ )
{
int m=0, mc=0, j, n;
/***********FILL***********/
while (k >= 2 && __mc < 10___)
{
/***********FILL***********/
if (k == 0 || _k == 0____)
{
m=m+k;
mc++;
}
k--;
}
/***********FILL***********/
__return (m)___;
}
main ( )
{
printf("%d\n", fun (500));
}
/*-------------------------------------------------------
【程序填空】
---------------------------------------------------------
功能:以下程序中,函數(shù)fun的功能是計算x^2-2x+6,主函數(shù)中將調(diào)用fun函數(shù)計算:
y1=(x+8)^2-2(x+8)+6
y2=(sin(x))^2-2sin(x)+6
請?zhí)羁铡?/P>
---------------------------------------------------------------*/
#include
#include
double fun(double x)
{
return(x*x-2*x+6);
}
main()
{
/***********FILL***********/
double x, ____ y1,y2______;
printf("Enter x:");
scanf("%lf",&x);
/***********FILL***********/
y1=fun( ___(8+x)______);
/***********FILL***********/
y2=fun( ___sin(x)______);
printf("y1=%lf,y2=%lf\n", y1, y2);
}
![]() | ![]() .. 定價:¥225 優(yōu)惠價:¥213 更多書籍 |
![]() | ![]() .. 定價:¥133 優(yōu)惠價:¥133.0 更多書籍 |