#include <cstdio>
int n = 1;
float sum = 0;
int factorial() {
int i;
int res1 = 0;
for (i = 0; i <= n; i++) {
res1 = res1 * i;
}
return res1;
}
int X3factorial(){
int i;
int res2 = 0;
int n3 = n * 3;
for (i = 0; i <= n3; i++){
res2 = res2 * i;
}
return res2;
}
int main(){
printf("Enter E > 0: ");
float epsilon;
scanf("%f", epsilon);
int n = 1;
float an = (3 * factorial())/X3factorial();
while (an > epsilon) {
int n = n++;
float sum = sum + an;
factorial();
X3factorial();
printf("%d %f", &n, &sum);
}
return 0;
}
scanf("%f", &epsilon);
int res1 = 0;
for(i = 0; i <= n; i++) {
res1 = res1 * i;
}
int res1 = 0
...
res1 = 0 * i;
float an = (3 * factorial())/X3factorial();
while (an > epsilon)
...
int n = 1;
float sum = 0;
...
int n = n++; // ???
Почему программа на C++ не выводит результат?