點一下柵格計算器的幫助,會有下面的解法
to calculate area:
dim output as double
dim parea as iarea
set parea = [shape]
output = parea.area
to calculate length or perimeter (depending on whether the features are lines or polygons):
dim output as double
dim pcurve as icurve
set pcurve = [shape]
output = pcurve.length
to add the x coordinate of points:
dim output as double
dim ppoint as ipoint
set ppoint = [shape]
output = ppoint.x
to add the x coordinate of polygon centroids:
dim output as double
dim parea as iarea
set parea = [shape]
output = parea.centroid.x
新建立乙個字段,在字段上有乙個caculator geometry 在點一下,會看到什麼……
匯入到gdb中,又會看到什麼……
utility下面有乙個工具也,看到了嗎?
給矩形面積求周長最小
input 輸入1個數s 1 s 10 9 output 輸出最小周長。sample input 24sample output 20這道題剛開始憨憨的沒管時間用兩個for去幹被爆tle,但後來發現是高中學的乙個均值不等式,給定乙個面積去求周長的最小值,可以用ab a b 2 4,用這個不等式當a ...
Problem E 求圓的面積和周長
problem e 求圓的面積和周長 time limit 1 sec memory limit 2 mb submit 16481 solved 6715 submit status web board description 從鍵盤輸入圓的半徑,求圓的面積和周長,圓周率取3.14。input 輸...
線段樹求周長求交面積的做法
求周長的做法是對每個段,用線段樹計算出不相交的區間個數,至於求區間個數,有點像掃瞄線的做法,也是先排序,排序之後就是求括號序列有多少個區間,很有技巧。然後就是段的長度 區間個數 2,然後對矩形座標進行關於y x對稱,再做一次就是完整的周長了。受求周長做法的啟發,可以得到求矩形交面積的做法,需要乙個一...