Zyava
Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору #include <math.h> void ComputeFirtsEquation() { // код для ввода x и eps double S = cos(x); double y = M_PI / 2.0 - 4.0 / M_PI * S; long i = 3; while(y < eps) { S += cos(i*x)/(i*i); y = M_PI / 2.0 - 4.0 / M_PI * S; i += 2; } } void ComputeSecondEquation() { //... } ComputeThirdEquation() { // ... } int main() { int input = 4; while(input != 0) { printf("Enter your choice:\n"); printf("0 - Exit\n"); printf("1 - Compute first equation(Ф2)\n"); printf("2 - Compute second equation(Ф4)\n"); printf("3 - Compute third equation(Ф5)\n"); scanf("%d", &input); switch (input) { case 1: ComputeFirtsEquation(); break; case 2: ComputeSecondEquation() break; case 3: ComputeThirdEquation() break; } } return 0; } |