1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #include <stdio.h> #include <conio.h> #include <math.h> void main() { float n; do { printf("\nEnter n = "); scanf("%f", &n); if(n < 1) { printf("Try enter n >= 1 ^_^ !"); } }while(n < 1); float S = 0, i = 2, j = 1, gt = 1; while(i <= n) { gt = gt * j; S = pow(gt + S, 1.0 / i); i++; j++; } printf("\nS = %f", S); getch(); } |
