View Code of Problem 115

#include<bits/stdc++.h>
using namespace std;
int main() {
	int n;
	int a[31];
	a[1]=1;
	for(int i=2;i<31;i++)
	{
		a[i]=a[i-1]+i;
	}
	while(cin>>n)
	{
		cout<<a[n]<<" "<<n*100000<<endl;
	}
}

Double click to view unformatted code.


Back to problem 115