최대 공약수
2910 단어 xml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" fontSize="12" fontFamily="Georgia">
<mx:Script>
<![CDATA[
import mx.controls.TextArea;
private function gongyueshu(txt1:String, txt2:String):String
{
var a1:int=parseInt(txt1);
var a2:int=parseInt(txt2);
//trace(a1);
var a:int=Math.max(a1, a2);
var b:int=Math.min(a1, a2);
var r:int=1;
// :%
while (r > 0)
{
r=a % b;
a=b;
b=r;
}
var res:String=a.toString();
return res
}
]]>
</mx:Script>
<mx:Panel title=" " width="394" height="351" horizontalAlign="center" layout="vertical" fontFamily="Verdana" fontSize="14">
<mx:HBox width="362" height="100%">
<mx:ApplicationControlBar dock="true" width="100%" height="100%" fillAlphas="[1.0, 1.0]" fillColors="[#F5F9E2, #F3FCCC]">
<mx:VBox height="257" width="220" fontSize="14" themeColor="#05578B" backgroundAlpha="0.0" borderColor="#F8F8F8" borderStyle="solid" borderThickness="0" fontFamily="Times New Roman">
<mx:Label text=" 1" width="100" color="#3C130B" alpha="1.0"/>
<mx:TextArea text="1" textAlign="right" id="text1" height="29" width="100" change="text3.text=gongyueshu(text1.text,text2.text)"/>
<mx:Label text=" 2" width="100"/>
<mx:TextArea text="2" textAlign="right" id="text2" height="28" width="100" change="text3.text=gongyueshu(text1.text,text2.text)"/>
<mx:Label text=" " width="100"/>
<mx:TextArea text="3" textAlign="right" id="text3" height="28" width="100" borderColor="#000406" themeColor="#85C3EA" color="#F7C8C4" backgroundColor="#0A092A"/>
<mx:HRule width="202" height="0" strokeColor="#0E0C70"/>
<mx:Button label=" 1、2 " click="text3.text=gongyueshu(text1.text,text2.text)" textAlign="center" width="200" id="button2" fontWeight="normal"/>
</mx:VBox>
</mx:ApplicationControlBar>
</mx:HBox>
</mx:Panel>
</mx:Application>
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
XML 소개나중에 나 자신과 물론 XML 😀에 대해 배워야 하는 모든 사람을 위해 참조로 사용할 수 있도록 짧은 소개를 작성하고 싶습니다. JSON을 JavaScript Objects 형태의 일반 텍스트로 데이터를 전송하는 방...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.