#include <iostream>
using namespace std
bool fun(int *a,int n)
{
int i=0int coun=0
while(i!=n)
{
if(a[i]==1)
{
coun++
i++
}
else{
i++
if(coun%2!=0)
return false
coun=0
}
}
if(coun%2==0) /////////要想想为什么
return true
return false
}
int main()
{
cout<<"input the size of the array: "<<endl
int size
cin>>size
int a[100]
cout<<"Input the value: "<<endl
for(int i=0i<sizei++)
{
cout<<"a["<<i<<"]"<<":"
cin>>a[i]
}
if(fun(a,size))
cout<<"there are all double"<<endl
else
cout<<"there are not all double"<<endl
cout <<"Hello world!" <<endl
return 0
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)