Created
February 14, 2015 02:50
-
-
Save shohan4556/08ca00053b7123926f6e to your computer and use it in GitHub Desktop.
URI 1323 solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// Author : Shohan | |
| /// URI 1323 | |
| /// Problem level : Easy | |
| #include<stdio.h> | |
| int main() | |
| { | |
| int ans,n,t; | |
| while(scanf("%d",&n)==1){ | |
| if(n==0) | |
| break; | |
| ans=(n*(n+1)) * (2*n+1); | |
| t=ans/6; | |
| printf("%d\n",t); | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment