fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6. int a,b;
  7. float x,y,c;
  8. printf("Vvedite snacheniya otrezka a i b, a takzhe znachenie shaga c\n");
  9. scanf("%d %d %f",&a,&b,&c);
  10. printf("-------------------------\n");
  11. printf("| x = | y = |\n");
  12. printf("-------------------------\n");
  13. x=a;
  14. while (x<=b)
  15. {
  16. y=sqrt(fabs(x-1)+sin(x));
  17. printf("| %2.1f | %2.1f |\n",x,y);
  18. x+=c;
  19. }
  20. return (0);
  21. }
Success #stdin #stdout 0s 10304KB
stdin
-1 4 0.5
stdout
Vvedite snacheniya otrezka a i b, a takzhe znachenie shaga c
-------------------------
| x =       | y =       |
-------------------------
| -1.0       | 1.1       |
| -0.5       | 1.0       |
| 0.0       | 1.0       |
| 0.5       | 1.0       |
| 1.0       | 0.9       |
| 1.5       | 1.2       |
| 2.0       | 1.4       |
| 2.5       | 1.4       |
| 3.0       | 1.5       |
| 3.5       | 1.5       |
| 4.0       | 1.5       |