标签:while clu ios using stdin close space return txt
AC代码:
#include <iostream> #include <cstdio> using namespace std; int main(void) { freopen("in.txt","r",stdin); long long n; while(scanf("%lld",&n)!=EOF) { if(n%2==0) printf("%lld\n\n",n/2*(n+1)); else printf("%lld\n\n",(n+1)/2*n); } fclose(stdin); return 0; }
标签:while clu ios using stdin close space return txt
原文地址:https://www.cnblogs.com/phaLQ/p/10024170.html