#include "stdio.h"
int main() {
long int s=2;
int a=1;
do
{s=s+a*20;a++;}while(a<=50);
printf("%ld\n",s);
return 0;
}
![](https://img2018.cnblogs.com/blog/1619445/201905/1619445-20190519101732514-1579119752.png)
#include "stdio.h"
int main() {
long int s=2;
int a=1;
while(a<=50)
{s=s+a*20;a++;}
printf("%ld\n",s);
return 0;
}
![](https://img2018.cnblogs.com/blog/1619445/201905/1619445-20190519101822868-152355185.png)
#include "stdio.h"
int main() {
long int s=2;
int a;
for(a=1;a<=50;a++)
s=s+a*20;
printf("%ld\n",s);
return 0;
}
![](https://img2018.cnblogs.com/blog/1619445/201905/1619445-20190519101901635-1253512107.png)
#include "stdio.h"
#include "math.h"
int main() {
int a,b,c,d=0;
for (a=1;a<=9;a++) {
for (b=0;b<=9;b++) {
for (c=0;c<=9;c++) {
if((a*100+b*10+c)==(pow(a,3)+pow(b,3)+pow(c,3)))
{printf("%d\n",a*100+b*10+c);d++;}
}
}
}
printf("%d\n",d);
return 0;
}
![](https://img2018.cnblogs.com/blog/1619445/201905/1619445-20190519101943310-20066300.png)
#include "stdio.h"
int main() {
int a,b,c,d=0;
for(a=1;a<=5;a++){
for(b=1;b<=5;b++){
for(c=1;c<=5;c++){
if(a!=b&&a!=c&&b!=c)
printf("%d\n",a*100+b*10+c);d++;
}
}
}
printf("%d", d);
return 0;
}
![](https://img2018.cnblogs.com/blog/1619445/201905/1619445-20190519102011997-1640157748.png)