int num, sd, td, hd,x,y;
for( num=100 ; num<1000 ;num++ )
{ x=num/100*100;
y=(num-x)/10*10;
//百位
hd =num/100 ;
//十位
td =(num-x)/10 ;
//个位
sd =(num-x-y)/1;
if( num==hd*hd*hd+td*td*td+sd*sd*sd )
for( num=100 ; num<1000 ;num++ )
{ x=num/100*100;
y=(num-x)/10*10;
//百位
hd =num/100 ;
//十位
td =(num-x)/10 ;
//个位
sd =(num-x-y)/1;
if( num==hd*hd*hd+td*td*td+sd*sd*sd )
2015-02-25
include <stdio.h>
int getWordNumber(n)
{
if(n == 1)
{
return 1;
}
else{
return getWordNumber(n-1)+n-1 ;
}
}
int main()
{
int num = getWordNumber(10);
printf("小明第10天会了:%d个单词。\n", num);
return 0;
}
int getWordNumber(n)
{
if(n == 1)
{
return 1;
}
else{
return getWordNumber(n-1)+n-1 ;
}
}
int main()
{
int num = getWordNumber(10);
printf("小明第10天会了:%d个单词。\n", num);
return 0;
}
2015-02-24
//使用for循环
for(i=1;i<=100;i++)
{
sum=sum+flag*i;
flag=flag*(-1);
}
printf("sum=%d\n",sum);
return 0;
for(i=1;i<=100;i++)
{
sum=sum+flag*i;
flag=flag*(-1);
}
printf("sum=%d\n",sum);
return 0;
2015-02-23
int age = 15;
int height = 162;
float weight = 82.5;
char isfat = 'y';
int height = 162;
float weight = 82.5;
char isfat = 'y';
2015-02-23