Print? /* Start the comments in the program header (to avoid any problems encountered during the submission of blog posts, the slash used to indicate that the comments have been deleted)

Source: Internet
Author: User

Print? /* Start the comments in the program header (to avoid any problems encountered during the submission of blog posts, the slash used to indicate that the comments have been deleted)
* Copyright and version Declaration of the program
* All rights reserved.
* File name: txt. c
* Author: liuyongshui
* Question: In the following addition formula, different symbols represent different numbers, and the same symbols represent the same numbers.
* C
*
* C
*
* + C is required
*
*________________
*
* 2 0 0 8
* Problem source:
* Completion date: January 1, April 10, 2013
* Version No.: V1.0
*/
 
# Include <stdio. h>
 
Int main ()
{
Int a; // indicates "all"
Int B; // indicates "yes"
Int c; // represents "Learning"
Int d; // represents "C"
Int l;
Int m;
Int n;
Int flag = 0;
 
//! = 0, B! = 0, c! = 0,! = B! = C and a <3 & a> 0
 
For (a = 1; a <3; a ++)
{
For (B = 1; B <10; B ++)
{
If (! = B)
{
For (c = 1; c <10; c ++)
{
If (c! = A & c! = B)
{
For (d = 0; d <10; d ++)
{
If (d! = C & d! = A & d! = B)
{
N = c * 10 + d;
M = B * 100 + c * 10 + d;
L = a * 1000 + B * 100 + c * 10 + d;

If (n + m + l = 2008)
{
Flag = 1; // if there is a valid number, mark it as 1;
Printf ("All = % d to = % d = % d C = % d \ n", a, B, c, d );
 
Printf ("all want to learn C = d % \ n", l );
 
Printf ("learn C = % d \ n", m );
 
Printf (" C = % d \ n", n );
}
}
}
}
}
}
}
}
 
If (flag = 0)
{
Printf ("no answer to this question! \ N ");
}

Return 0;
}

/* Start the comments in the program header (to avoid any problems encountered during the submission of blog posts, the slash used to indicate that the comments have been deleted)
* Copyright and version Declaration of the program
* All rights reserved.
* File name: txt. c
* Author: liuyongshui
* Question: In the following addition formula, different symbols represent different numbers, and the same symbols represent the same numbers.
* C
*
* C
*
* + C is required
*
*________________
*
* 2 0 0 8
* Problem source
* Completion date: January 1, April 10, 2013
* Version No.: V1.0
*/

# Include <stdio. h>

Int main ()
{
Int a; // indicates "all"
Int B; // indicates "yes"
Int c; // represents "Learning"
Int d; // represents "C"
Int l;
Int m;
Int n;
Int flag = 0;

//! = 0, B! = 0, c! = 0,! = B! = C and a <3 & a> 0

For (a = 1; a <3; a ++)
{
For (B = 1; B <10; B ++)
{
If (! = B)
{
For (c = 1; c <10; c ++)
{
If (c! = A & c! = B)
{
For (d = 0; d <10; d ++)
{
If (d! = C & d! = A & d! = B)
{
N = c * 10 + d;
M = B * 100 + c * 10 + d;
L = a * 1000 + B * 100 + c * 10 + d;

If (n + m + l = 2008)
{
Flag = 1; // if there is a valid number, mark it as 1;
Printf ("All = % d to = % d = % d C = % d \ n", a, B, c, d );

Printf ("all want to learn C = d % \ n", l );

Printf ("learn C = % d \ n", m );

Printf (" C = % d \ n", n );
}
}
}
}
}
}
}
}

If (flag = 0)
{
Printf ("no answer to this question! \ N ");
}

Return 0;
}

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.