由三位不同数字构成的三位十进制整数abc(a≠0,a≠b≠c)若能被(a+b+c)2除尽,则abc为三位数,如405

1个回答

  • (1) 102

    附代码:

    #include

    using namespace std;

    int main()

    {

    x05int a,b,c,d,e,total;

    x05d = e = 0;

    x05for( a = 1; a < 10; a++ )

    x05{

    x05x05for( b = 0; b < 10; b++ )

    x05x05{

    x05x05x05for( c = 0; c < 10; c++ )

    x05x05x05{

    x05x05x05x05total = 100 * a + 10 * b + c;

    x05x05x05x05if( a != b & a != c & b != c & total % ( 2 * ( a + b + c )) == 0 )

    x05x05x05x05{

    x05x05x05x05x05cout