. NET Basic Article _ Learning Note _ Sixth day _for Loop Grammar _ positive sequence output and reverse output

Source: Internet
Author: User

For tab and Forr tab

1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4 usingSystem.Text;5 usingSystem.Threading.Tasks;6 7 namespaceSixth day _do_while cycle8 {9     class ProgramTen     { One         Static voidMain (string[] args) A         { -              for(inti = -; I <=999; i++) -             { the  -                 intBai = i/ -; -                 intShi = i% -/Ten; -                 intGE = i%Ten; +                 if(bai*bai*bai+shi*shi*shi+ge*ge*ge==i) -                 { +Console.WriteLine ("Narcissus number has {0}", i); A                 } at             } - Console.readkey (); -         } -     } -}

1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4 usingSystem.Text;5 usingSystem.Threading.Tasks;6 7 namespaceSixth day _do_while cycle8 {9     class ProgramTen     { One         Static voidMain (string[] args) A         { -             intsum =0; -             intn = -; the              for(inti =1; I <=n; i+=2) -             { -Sum + =i; -             } + Console.WriteLine (sum); - Console.readkey (); +         } A}

Within 100 all even and, all odd and, all integers and ...

. NET Basic Article _ Learning Note _ Sixth day _for Loop Grammar _ positive sequence output and reverse output

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.