以下为什么运行不了?
#include<iostream>
using namespace std;
void main()
{
int a[6];n=0,s=0;
for (int i=0;i<=5;i++)
{
cin>>a[i];
if (a[i]>0)n++;
s+=a[i];
}
cout<<"正数有"<<n<<"个"<<endl;
cout<<"总数"<<s<<endl;
#include<iostream>
using namespace std;
void main()
{
int a[6];n=0,s=0;
for (int i=0;i<=5;i++)
{
cin>>a[i];
if (a[i]>0)n++;
s+=a[i];
}
cout<<"正数有"<<n<<"个"<<endl;
cout<<"总数"<<s<<endl;
2017-03-29
举报