#include<stdio.h>
int main(){
    int n,r1,r2,r3,r4;
    n=100;
    r1=n*(n+1)/2;
    r2=(n+1)*n/2;
    r3=n/2*(n+1);
    r4=(n+1)/2*n;
    printf("n=%d\n",n);
    printf("r1=%d\n",r1);
    printf("r2=%d\n",r2);
    printf("r3=%d\n",r3);
    printf("r4=%d\n",r4);
    return 0;
} 

posted on 2021-03-13 13:43  花语吖  阅读(6)  评论(0编辑  收藏  举报