Riki_Tiki_Tavi Posted September 26, 2010 Report Share Posted September 26, 2010 вот задание: Подсчитать и вывести на экран значение функции y (x), где х - целое число: #include <stdio.h> #include <math.h> #include <conio.h> int main() { int x; double y; printf ("Bbedit x \n"); scanf ("%d",&x); switch (x) { case 20: y=10; break; case 10: y=(double log)(fabs(x)); break; case 1: y=fabs(pow(x)1/4); break; case 5.6: y=tan(x)+fabs(x); break; default: y=atan(x); } printf ("y= %d"&x); getch (); return 0; } что тут не правильно?помогите пожалуйста. Link to comment Share on other sites More sharing options...
Тролль Posted September 26, 2010 Report Share Posted September 26, 2010 Riki_Tiki_Tavi: #include <stdio.h>#include <math.h>#include <conio.h>int main(){ int x; float y;printf ("Bbedit x \n");scanf ("%d",&x);switch (x){ case 20: y=10; break;case 10: y=log(fabs(x)); break;case 1: y=fabs(pow(x,4)); break;case 5: case 6: y=tan(x)+fabs(x); break;default: y=atan(x);}printf ("y=%f",y);getch ();return 0;} Link to comment Share on other sites More sharing options...
Riki_Tiki_Tavi Posted September 26, 2010 Author Report Share Posted September 26, 2010 Riki_Tiki_Tavi: #include <stdio.h>#include <math.h>#include <conio.h>int main(){ int x; float y;printf ("Bbedit x \n");scanf ("%d",&x);switch (x){ case 20: y=10; break;case 10: y=log(fabs(x)); break;case 1: y=fabs(pow(x,4)); break;case 5: case 6: y=tan(x)+fabs(x); break;default: y=atan(x);}printf ("y=%f",y);getch ();return 0;} Спасибо огромное за помощь! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now