[2016-05-10] [51nod] [1015 Daffodil Count]

Source: Internet
Author: User

    • Time: 2016-05-10-16:23:29 Tuesday
    • Title Number: [2016-05-10][51nod][1015 Narcissus number]
    • Main topic:
      • Narcissus number refers to an n-digit (n >= 3), and the sum of the number of its digits on each bit is equal to its own. (Example: 1^3 + 5^3 + 3^3 = 153),
      • Given an integer m, the minimum number of daffodils for >= M is obtained.
    • Analysis: Just figure out the first few daffodils.
  
 
  1. #include<stdio.h>
  2. using namespace std;
  3. int main(){
  4. int m;
  5. scanf("%d",&m);
  6. if(m > 407){
  7. puts("1634");
  8. }else if(m > 371){
  9. puts("407");
  10. }else if(m > 370){
  11. puts("371");
  12. }else if(m > 153){
  13. puts("370");
  14. }else puts("153");
  15. }


From for notes (Wiz)

[2016-05-10] [51nod] [1015 Daffodil Count]

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.