Написал программу. Компиллироваться не хочет. Помогите исправить ошибки:
C++ |
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
28
29
30
31
| #include <iostream>
using namespace std;
int main ()
{
int n, i, cnt;
extern int a[];
double sum, temp, res;
cout<<"Enter the number of array elements"<<endl;
cin>>n;
for (i=0;i<=n,i++)
{
if (i%2=0)
{
cout<<"input "<<i<<" element of array"<<endl;
cin>>temp;
a[i]=sin(temp/2);
else
cout<<"input "<<i<<" element of array"<<endl;
cin>>temp;
a[i]=(pow(tan,2))*temp;
}
}
for (i=0; i<n< i++)
if (a[i]>0)
{
sum +=a[i];
++cnt
};
cout<<"Your average is: "<<res<<endl;
system ("pause");
} |
|