6 solutions

  • 0
    @ 2023-10-30 12:56:31
    #include <stdio.h>
    int main()
    {
        long i,n,sum;
        i = 1;
        sum = 0;
        scanf("%ld",&n);
        do{
            sum = sum+i;
            i++;
        }while(i<=n);
        printf("%ld",sum);
        return 0;
    }
    

    Information

    ID
    34
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    8
    Tags
    # Submissions
    2824
    Accepted
    410
    Uploaded By