写出来了,结果一样,就是太罗嗦了,能帮忙把改减的减减吗,只能用if,别的基本都不能用,是一道刚看了2张的题,能帮忙的帮下,多谢指教.下面是我写的:
int main()
{
int number,aquare,cube;
number=0;
aquare=number*number;
cube=aquare*number;
printf("number\taqrare\tcube\n");
printf("%d\t %d\t %d\n",number,aquare,cube);
if (number=number+1){
aquare=number*number;
cube=aquare*number;
printf("%d\t%d\t%d\n",number,aquare,cube);
}
if (number=number+1){
aquare=number*number;
cube=aquare*number;
printf("%d\t%d\t%d\n",number,aquare,cube);
}
if (number=number+1){
aquare=number*number;
cube=aquare*number;
printf("%d\t%d\t%d\n",number,aquare,cube);
}
if (number=number+1){
aquare=number*number;
cube=aquare*number;
printf("%d\t%d\t%d\n",number,aquare,cube);
}
if (number=number+1){
aquare=number*number;
cube=aquare*number;
printf("%d\t%d\t%d\n",number,aquare,cube);
}
if (number=number+1){
aquare=number*number;
cube=aquare*number;
printf("%d\t%d\t%d\n",number,aquare,cube);
}
if (number=number+1){
aquare=number*number;
cube=aquare*number;
printf("%d\t%d\t%d\n",number,aquare,cube);
}
if (number=number+1){
aquare=number*number;
cube=aquare*number;
printf("%d\t%d\t%d\n",number,aquare,cube);
}
if (number=number+1){
aquare=number*number;
cube=aquare*number;
printf("%d\t%d\t%d\n",number,aquare,cube);
}
if (number=number+1){
aquare=number*number;
cube=aquare*number;
printf("%d\t%d\t%d\n",number,aquare,cube);
}
}