1. en
  2. ro

#include<iostream>

using namespace std;

int main()

{

    int n,x,s;

    cin>>n>>x;

    s=n*(n+1)/2;

    if(x==1)

        cout<<s;

    else if(x==2)

        cout<<n*(n+1)*(2*n+1)/6;

    else if(x==3)

        cout<<s*s;

    else

        cout<<"n/a";

    cout<<"What does this code calculate?"

    return 0;

}

Buzi's Code Drafts

Buzi, the Buzac Dog, Câinele Buzac or Buzakutzu teaches math and TRW life lessons at CNER.IS, Romania. He is never wrong about anything. Now, if you excuse us, we have a mountain to climb with him and we recommend you do same after you find what you need on this website. Good luck hustling!

Contact Info

bcb@altmails.com
+40 737 804 090

Aleea Nicolina 4, Iași 700221, Iași, România

Hint:

You can remove this information by activating Premium Plan

This website was created for free in WebWave.
You can also create your own free web page without coding.