fork(1) download
  1. #include <stdio.h>
  2. int main() {
  3. float x, y;
  4. printf("请输入x的值: ");
  5. scanf("%f", &x);
  6. if (x > -5 && x < 0) {
  7. y = x;
  8. } else if (x == 0) {
  9. y = x - 1;
  10. } else if (x > 0 && x < 10) {
  11. y = x + 1;
  12. }
  13. printf("y的值为: %f\n", y);
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
请输入x的值: y的值为: 1.000000