Shell---related simple program normalization

Source: Internet
Author: User

1, 1-100 number summation

① non-recursive method

Shell

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/83/0B/wKiom1dpIcHBcRrUAABevxRp8l8674.jpg "title=" Sum1.jpg "style=" Float:none; "alt=" wkiom1dpichbcrruaabevxrp8l8674.jpg "/>

Operation Result:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/83/0B/wKiom1dpIcKTs82fAACkrzbroSk597.jpg "title=" Sum1-1.jpg "style=" Float:none; "alt=" wkiom1dpickts82faackrzbrosk597.jpg "/>

② Recursive method

Shell

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/83/0B/wKioL1dpP6jCUy0WAAA51qzmBu0450.jpg "style=" float: none; "title=" summation 1.jpg "alt=" Wkiol1dpp6jcuy0waaa51qzmbu0450.jpg "/>

Operation Result:

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/83/0C/wKiom1dpP6iAm-ScAAAURu6oe3U556.jpg "style=" float: none; "title=" summation 1-1.jpg "alt=" Wkiom1dpp6iam-scaaauru6oe3u556.jpg "/>

2. Progress bar

Shell

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/83/0A/wKioL1dpIb7D0XktAABoaufv6oM324.jpg "style=" float: none; "title=" process-bar.jpg "alt=" Wkiol1dpib7d0xktaaboaufv6om324.jpg "/>

Operation Result:

650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M02/83/0A/wKioL1dpIcDR3uKiAABK2FK3eqg337.jpg "style=" float: none; "title=" process-bar-1.jpg "alt=" Wkiol1dpicdr3ukiaabk2fk3eqg337.jpg "/>

3. Read multiple numbers in the file to get Max, Min, avg.

Shell

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/83/0A/wKioL1dpIw2z1H3aAABsAhFXeXw596.jpg "style=" float: none; "title=" max-min.jpg "alt=" Wkiol1dpiw2z1h3aaabsahfxexw596.jpg "/>

Operation Result:

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/83/0B/wKiom1dpIw7S1KFWAAA_0fqqRls664.jpg "style=" float: none; "title=" max-min-1.jpg "alt=" Wkiom1dpiw7s1kfwaaa_0fqqrls664.jpg "/>

4, string interception "Related: http://zxtong.blog.51cto.com/10697148/1790030"

(1) Use the command: "# #" "#" "percent" "%"

(2) Using the Cut tool:

Shell

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/83/0A/wKioL1dpI2DwzV1uAABbuloy0rA687.jpg "style=" float: none; "title=" strcut.jpg "alt=" Wkiol1dpi2dwzv1uaabbuloy0ra687.jpg "/>

Operation Result:

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/83/0B/wKiom1dpI2HjWcfQAAA5IvhHeyg917.jpg "style=" float: none; "title=" strcut-1.jpg "alt=" Wkiom1dpi2hjwcfqaaa5ivhheyg917.jpg "/>


5, Fibonacci that cut series

① non-recursive method

Shell

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/83/0B/wKiom1dpJUKy1SWGAABXzjq3U0I836.jpg "style=" float: none; "title=" fib.jpg "alt=" Wkiom1dpjuky1swgaabxzjq3u0i836.jpg "/>

Operation Result:

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/83/0A/wKioL1dpJULRd0ADAAASdYjM0sA557.jpg "style=" float: none; "title=" fib-1.jpg "alt=" Wkiol1dpjulrd0adaaasdyjm0sa557.jpg "/>


② Recursive method

Shell

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M00/83/0F/wKiom1dp9VuifjqGAABGU1rkno0203.jpg "style=" float: none; "title=" fib222=0.jpg "alt=" Wkiom1dp9vuifjqgaabgu1rkno0203.jpg "/>

Operation Result:

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/83/0E/wKioL1dp9VywV2mKAAAfZpSfx34356.jpg "style=" float: none; "title=" fib222-1.jpg "alt=" Wkiol1dp9vywv2mkaaafzpsfx34356.jpg "/>


Summarize:

Shell program writing, self-sensing program is relatively simple, but the format of the program is extremely error-prone, so need more practice, familiar with various formats.


This article is from the "Flower Open Shore" blog, please be sure to keep this source http://zxtong.blog.51cto.com/10697148/1791614

Shell---related simple program normalization

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.