/*
y =x(x<1)
y =2x-1(x>=1&&x<10)
y =3x-11(x>=10)
*/
#include <stdio.h>
#include <math.h>

int main()
{
    int x,y;
    printf("请输入x的值\n");
    scanf("%d",&x);
    if(x>=1)
       if(x<10)
       y=2*x-1;
       else
       y=3*x-11;
    else
    y=x;
    printf("y=%d",y);
    return 0;
}

有一函数,写程序 输入x的值,输出y相应的值

相关文章:

  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
相关资源
相似解决方案