1. #!/bin/bash #0-100相加,for循环 declare -i i declare -i sum for i in {1..100};do let sum+=i let i++ done echo $sum 2. #!/bin/bash #0-100相加,until循环 declare -i x=0 declare -i sum until [ $x -gt 100 ] do let sum+=x let x++ done echo -e "the result is $sum
VBScript条件语句 我们可以使用四种条件语句 If - Then - 语句 If - Then - Else 语句 If - Then - ElseIf 语句 Select - Case 语句 通过下面这段代码(ConditionalStatement.asp)我们演示所有的条件语句用法: <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Option Explicit %> <!-- '如
递归的例子1 计算1到100相加的值 public partial class Default4 : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Response.Write(checks(100)); } } public static int c