#include
void
main(){
int
i,n,sumA=0,sumB=0;
printf("请输入一度个整数问:答");
scanf("%d",&n);
for(i=1;i<=n;i++){
if(i%2==1){
numA+=i;
}else
if(i%2==0){
numB+=i;
}
}
printf("奇数版和是:权%d\n",numA);
printf("偶数和是:%d",numB);
}
#include
void main(){
int i,n,sumA=0,sumB=0;
printf("请输入一个整数:");
scanf("%d",&n);
for(i=1;i<=n;i++){
if(i%2==1){
numA+=i;
}else if(i%2==0){
numB+=i;
}
}
printf("奇数和是:%d\n",numA);
printf("偶数和是:%d",numB);
}
int i,evenNumberSum=0,unevenNumberSum=0,n;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(i%2==0)unevenNumberSum+=i;
else evenNumberSum+=i;
}