//---------------------------------------------------------------------------
#include "vcl.h"
#include "iostream"
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
using namespace std;
void main(int argc, char** argv)
{
int s,i,n;
s=0;
cout<<"请输入一个整数n:";
cin>>n;
for(i=0;i<=n;i++)
s+=i*i;
cout<<s<<endl;
}
C++ Builder 控制台程序 demo
最新推荐文章于 2024-10-05 14:02:30 发布