【正文】
Begin temp:=x。 ②當(dāng)全程量和局部量同名時(shí),全程量的作用域不包含局部量的作用域。 writeln(a:3,b:3)。 begin begin t:=x。 if a> b then swap (a,b)。 Begin write(‘Please input m,n:’)。Input 5 numbers:39。 t1 := max(t1,n2)。 ?函數(shù)定義的一般格式 : FUNCTION 函數(shù)名 (形式參數(shù)表 ):函數(shù)類型 。 t1 := max(t1,n3)。)。 read (m,n)。 {調(diào)用自定義過(guò)程} if a> c then swap (a,c)。x:=y。 writeln(a:3,b:3)。 分析該程序,寫出運(yùn)行結(jié)果 Program ex4。 x:=y。 Var temp:integer。全程量的作用域分兩種情況: ①當(dāng)全程量和局部量不同名時(shí),其作用域是整個(gè)程序范圍(自定義起直到主程序結(jié)束)。 swap(a,b)。 var t:integer。 readln(a,b,c)。 End。 Begin {主程序} write(39。 t1 := n1。 {函數(shù)首部 } 變量說(shuō)明部分 。 t1 := max(t1,n4)。 readln(n1,n2,n3,n4,n5)。 if (n=0) and (nm) then begin cmn:= fac(m) div (fac(n)*fac(mn))。 if b> c fhen swap (b,c)。y:=t。 end. end. 1 2 1 2 1 2