include stdio include stdlib define 50 int main void double int printf

 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 <stdlib.h>
#define N 50
int main(void)
{
double A[N], B[N];
int i, k=0;
printf ("Ââåäèòå ðÿä ÷èñåë À:\n");
for (i=1; i<N; i++)
scanf ("%lf", &A[i]);
for (i=1; i<N; i++)
{
B[i]=B[i-1]+A[i];
if (B[i]<0) k++;
}
printf ("Ïîóë÷åííûé ðÿä B:\n");
for (i=1; i<N; i++)
printf ("%lf\n", B[i]);
printf ("Êîë-âî îòðèöàòåëüíûõ ÷ëåíîâ:%d\n", k);
system("PAUSE");
return 0;
}