作者在 2009-02-13 12:36:40 发布以下内容
#include <stdio.h>
int main(void)
{
int num, baiwei, shiwei, gewei, i, j;
i = j = 0;
for (num = 100; num < 999 ; ++num)
{
baiwei = num / 100;
shiwei = (num - baiwei*100) / 10;
gewei = num - baiwei*100 - shiwei *10;
if ((baiwei != shiwei) && (baiwei != gewei) && (shiwei != gewei))
{
printf("%d ",num);
++i;++j;
}
if( i == 10 )
{
printf("\n");
i=0;
}
}
printf("\nthe total is %d",j);
getch();
return 0;
}
{
int num, baiwei, shiwei, gewei, i, j;
i = j = 0;
for (num = 100; num < 999 ; ++num)
{
baiwei = num / 100;
shiwei = (num - baiwei*100) / 10;
gewei = num - baiwei*100 - shiwei *10;
if ((baiwei != shiwei) && (baiwei != gewei) && (shiwei != gewei))
{
printf("%d ",num);
++i;++j;
}
if( i == 10 )
{
printf("\n");
i=0;
}
}
printf("\nthe total is %d",j);
getch();
return 0;
}