Задание максимально простое, а что не знаешь гугли( например про сумму ряда). А халявничать так - ничего не узнаешь и не выучишь)
#include <math.h> #include <stdint.h> #include <stdio.h> int main(void) { uint8_t n, i; uint64_t f; double r; n = 0u; i = f = 1u; r = 1.; scanf("%hhu", &n); if (21u <= n) { fprintf(stderr, "%hhu > 2^64 - 1\n", n); return 1; } for (; i <= n; i++) { r += 1. / (f *= i); } printf("%lf\n%lf\n", r, M_E); } C #include <math.h> #include <stdint.h> #include <stdio.h> int main(void) { uint8_t n, i; uint64_t f; double r; n = 0u; i = f = 1u; r = 1.; scanf("%hhu", &n); if (21u <= n) { fprintf(stderr, "%hhu > 2^64 - 1\n", n); return 1; } for (; i <= n; i++) { r += 1. / (f *= i); } printf("%lf\n%lf\n", r, M_E); } --- Сообщение объединено с предыдущим 18 сен 2021 #include <math.h> #include <stdio.h> int main(void) { const double a = 1.3, b = 2.5; double t, z; t = z = .0; scanf("%lf", &t); if (.5 > t || 3. < t) { fprintf(stderr, "<t> must be in [.5; 3]\n"); return 1; } (t < a) && (z = a * t * t - b * sqrt(t + 1)); (a <= t && t <= b) && (z = a - b); (t > b) && (z = a * pow(t, 2. / 3) - pow(t + 1, 1. / 3)); printf("%lf\n", z); } C #include <math.h> #include <stdio.h> int main(void) { const double a = 1.3, b = 2.5; double t, z; t = z = .0; scanf("%lf", &t); if (.5 > t || 3. < t) { fprintf(stderr, "<t> must be in [.5; 3]\n"); return 1; } (t < a) && (z = a * t * t - b * sqrt(t + 1)); (a <= t && t <= b) && (z = a - b); (t > b) && (z = a * pow(t, 2. / 3) - pow(t + 1, 1. / 3)); printf("%lf\n", z); }