AC代码:
#include <iostream> #include <cstdio> using namespace std; int main(void) { freopen("in.txt","r",stdin); int n; while(scanf("%d",&n)!=EOF) { printf("%lld ",1+(n*n*n+5*n)/6); } fclose(stdin); return 0; }
AC代码:
#include <iostream> #include <cstdio> using namespace std; int main(void) { freopen("in.txt","r",stdin); int n; while(scanf("%d",&n)!=EOF) { printf("%lld ",1+(n*n*n+5*n)/6); } fclose(stdin); return 0; }