【入门题】奇数偶数和
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
题目描述
利用for循环,分别计算1—100中奇数的和、偶数的和。输入格式
无输入。输出格式
两行,第一行输出“the sum of odd numbers 1 to 100 is : ”奇数和,第二行输出“the sum of even numbers 1 to 100 is : ”偶数和。(仔细对照样例输出)the sum of odd numbers 1 to 100 is : 2500
the sum of even numbers 1 to 100 is : 2550