范围:1000<?<9999
#include<bits/stdc++.h>
using namespace std;
int main()
{
int i=1000;
while(i<=9999)
{
if((i/100+i%100)*(i/100+i%100)==i)
{
cout<<i<<endl;
}
i++;
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int i=1;
while(i<=500)
{
if(i%3==2&&i%5==3&&i%7==2)
{
cout<<i<<endl;
}
i++;
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,s=1,i=1;
cin>>n;
while(i<=n)
{
s=s*i;
i++;
}
cout<<s;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int i=100,s=0;
while(i>=1)
{
s=s+i;
i-=3;
}
cout<<s;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i=1,s=0;
cin>>n;
while(i<=n)
{
s=s+i;
i++;
}
cout<<s;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i=1,s=0;
cin>>n;
while(i<=n)
{
if(i%2==1)
{
s=s+i;
}
i++;
}
cout<<s;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i=100,a,b,c;
while(i<=999)
{
a=i/100%10;
b=i/10%10;
c=i%10;
if(a*a*a+b*b*b+c*c*c==i)
{
cout<<i<<endl;
}
i++;
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i=1;
double s=0;
cin>>n;
while(i<=n)
{
s=s+1.0*1/i;
i++;
}
cout<<fixed<<setprecision(3)<<s;
return 0;
}