#include <stdio.h> int main(){ int A,B; int sum=0; int count=0; if (scanf("%d %d",&A,&B)!=EOF){ for (int i=A;i<=B;i++){ count++; sum+=i; printf("%5d",i); if (count%5==0){printf("\n");count=0;} } if (count!=0){printf("\n");} printf("Sum = %d",sum); }else{ printf("input wrong"); } }
c语言编程练习题:7-154 求整数段和
作者:yunjinqi
类别:编程
日期:2023-05-31 17:48:46
阅读:595 次
消耗积分:0 分
版权所有,转载本站文章请注明出处:云子量化, https://www.yunjinqi.top/article/279
最新文章
系统当前共有 405 篇文章