#include
voidmain()
{
inta[10],i,sum=0;
for(i=0;i
{
a[i]=i;
if(i%2!=0)
sum+=i;
}
printf("下標為奇數的數組元素之和:%d\n",sum);
}
#include<stdio.h>voidmain(){inta[10],i,sum=0;for(i=0;i<10;++i){a[i]=i;if(i%2!=0)sum+=i;}printf("下標為奇數的數組元素之和:%d\n",sum);}
#include
voidmain()
{
inta[10],i,sum=0;
for(i=0;i
{
a[i]=i;
if(i%2!=0)
sum+=i;
}
printf("下標為奇數的數組元素之和:%d\n",sum);
}
#include<stdio.h>voidmain(){inta[10],i,sum=0;for(i=0;i<10;++i){a[i]=i;if(i%2!=0)sum+=i;}printf("下標為奇數的數組元素之和:%d\n",sum);}