c++程序问题
#include <iostream.h>using namespace std;void main(){ int i,j,n; float sum=0,s; cout<<"输入n="; cin>>n; for(i=1;i<n+1;i++) { s=0.0; for(j=1;j<=i;j++) s+=j; sum+=s; } cout<<"s=1+(1+2)+(1+2+3)+…+(1+2+3+…+n)="<<sum<<endl; }C:\Documents and Settings\Administrator\桌面\001.cpp(7) : error C2871: 'std' : does not exist or is not a namespace
#include <iostream>using namespace std;void main(){ int n,s,sum=0; cin>>n; for(int i=1;i<=n;i++) { s=0; for(int j=1;j<=i;j++) s+=j; sum+=s; } cout<<sum<<endl;}