열여덟째

899 단어
 13   1:
    :        ,                      
    :              

#include <iostream>  
using namespace std;
const double x1=0.3, x2=0.8; //        ,  ,   
double f(double);     //          f   
int main( )
{
 double x;
 cout<<"   x  :";
 cin>>x;
 cout<<"  :f("<<x<<")="<< f(x)<<"
"; return 0; } double f(double x) { double i; if(x<x1) i=0.0; else if((x>x1)&&(x<x2)) i=(x-x1)/(x2-x1); else if(x>x2) i=1.0; return i; } // ( “?” ): (1) “ / ” ( , , ), , 1 x=0.2 0 0 2 x=0.5 0.4 0.4 3 x=0.7 1 1 (2) “ ” , , , 4 x=0.3 0 0 5 x=? 1 1

좋은 웹페이지 즐겨찾기