Please write a Java program,compute the GreatestCommonDivisor求JAVA程序
来源:学生作业帮助网 编辑:作业帮 时间:2024/05/02 16:35:49
Please write a Java program,compute the GreatestCommonDivisor求JAVA程序
Please write a Java program,compute the GreatestCommonDivisor
求JAVA程序
Please write a Java program,compute the GreatestCommonDivisor求JAVA程序
// m,n > 0
public class Test {
\x05public static void main(String[] args){
\x05\x05Test t = new Test();\x05\x05
\x05\x05System.out.println(t.getGreatestCommonDivisor(36,8));\x05\x05
\x05}
\x05public int getGreatestCommonDivisor(int m,int n) {
\x05 if(m < n) {
\x05 int temp = 0;
\x05 temp = m;
\x05 m = n;
\x05 n = temp;
\x05 }
\x05 int r = m % n;
\x05 while(r != 0){
\x05 m = n;
\x05 n = r;
\x05 r = m % n;
\x05 }
\x05 return n;
\x05}
}
Please write a Java program,compute the GreatestCommonDivisor求JAVA程序
Please write a _______ for our shop.
please install java
Java write a program to calculate the factorial of any natural number entered by a user.
write a program to represent multiplication tables.用最简单的JAVA语言.
Please read the chart carefully,then write a short passage.
____(write) a letter to me,please.填原型么
write a report on an animal in danger please
please write a letter ( ) your pen pel ()english
please write a report o------- the changs in your hometown.
please give me a piece of paper to____(write) A write on B be written on
This is a new word.please ( ) A.write down it B.write it down C.write then down 原因
( )Please pass me a pen ___.A.to write on B.write wth C.to write with D.writing on
please pass me a pen ___.A.to write on B.write with C.to write with D.writingrt
单选:Please give me a pen___.A.to write with B.to write C.for write D.written
Please write soon!
Please write to me.
Please write soon.