Code
#include <stdio.h>
int main()
{
int n,i,num,Xin=0,Jian=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&num);
if(i%2 == 0)
Jian += num;
else
Xin += num;
}
if(Xin > Jian)
printf("Greater than\n");
else if(Jian > Xin)
printf("Less than\n");
else
printf("Equal\n");
return 0;
}
反思:for循环练习,交叉求和,最后比较两人所拿点数的大小。