Sdut 2867 Primary Olympiad (Lower) (regular)

Source: Internet
Author: User

Primary School Olympiad (lower) Time limit:1000ms Memory limit:65536k have questions? Dot here ^_^ The title of the Summer, the ACM Association of Welfare, a lot of watermelon, clever Xiao Ming is very fond of thinking, a watermelon, n knife can be cut into several points? Can you help him out? Enter multiple sets of inputs, one for each group, until the end of the file. Enter an n (0≤n≤100). Output for each set of inputs, output a single number, n knives can cut the watermelon into several parts. Sample input
123
Sample output
248
Hint Source sample Program


#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include < String.h> #include <math.h>using namespace Std;int main () {    int a[110];    for (int i=0;i<=101;i++)    {        A[i] = (i*i*i + 5*i)/6 + 1;    }    int n;    while (scanf ("%d", &n)!=eof)    {        printf ("%d\n", A[n]);    }    


Sdut 2867 Primary Olympiad (Lower) (regular)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.