实验三
作者:互联网
#include "stdafx.h"
#include<stdio.h>
int main()
{ long i,s=0;
for(i=22;i<=1002;i=i+20)
s=s+i;
printf("%d\n",s);
return 0;
}
#include "stdafx.h"
#include<stdio.h>
int main()
{ long i=22,s=0;
while(i<=1002){
s=s+i;
i=i+20;}
printf("%d\n",s);
return 0;
}
#include "stdafx.h"
#include<stdio.h>
int main()
{ long i=22,s=0;
do{s=s+i;
i=i+20;}
while(i<=1002);
printf("%d\n",s);
return 0;
}
#include "stdafx.h"
#include<stdio.h>
int main()
{ int a,b,c=0,i,j,k;
a=100;
for(a;a<=999;a++)
{
i=a/100;
j=(a/10)%10;
k=a%10;
b=i*i*i+j*j*j+k*k*k;
if(a==b)
{
printf("%d\n",a);
c=c+1;}}
printf("%d\n",c);
return 0;
}
#include "stdafx.h"
#include<stdio.h>
int main()
{ int i,j,k,a,b=0;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i==j)
continue;
for(k=1;k<=5;k++)
{
if((k==i)||(k==j))
continue;
a=i*100+j*10+k;
printf("%d\n",a);
b++;
}
}
}printf("%d\n",b);
return 0;
}
标签:main,return,实验,includeint,printf,stdafx,include 来源: https://www.cnblogs.com/P201821430023/p/10838368.html