JAVAÇó2¸öÊýµÄ×î´ó¹«Ô¼ÊýºÍ×îС¹«±¶Êý
//ÇóÁ½ÊýµÄ×î´ó¹«Ô¼ÊýºÍ×îС¹«±¶Êý
import java.util.*;
public class Dais02
{
public static void main(String args[])
{
int m,n;
Scanner s = new Scanner(System.in);
System.out.println("ÇëÊäÈëÄãÏëÒªÊÇÊý×Ö");
m = s.nextInt();
n = s.nextInt();
int total,r;
total = m*n;
do
{
if(m<n)
{
int t = m ;
m = n ;
n = t ;
}
r = m % n;
m = n ;
n = r ;
}while(r!=0);
System.out.println("×î´ó¹«ÒòÊýÊÇ£º"+m);
System.out.println("×îС¹«±¶ÊÇ£º"+total/m);
}
}
Ïà¹ØÎĵµ£º
JAVAºÍC++¶¼ÊÇÃæÏò¶ÔÏóÓïÑÔ¡£Ò²¾ÍÊÇ˵£¬ËüÃǶ¼Äܹ»ÊµÏÖÃæÏò¶ÔÏó˼Ï루·â×°£¬¼Ì³Ë£¬¶à̬£©¡£¶øÓÉÓÚc++ΪÁËÕչ˴óÁ¿µÄCÓïÑÔʹÓÃÕߣ¬¶ø¼æÈÝÁËC£¬Ê¹µÃ×ÔÉí½ö½ö³ÉΪÁË´øÀàµÄCÓïÑÔ£¬¶à¶àÉÙÉÙÓ°ÏìÁËÆäÃæÏò¶ÔÏóµÄ³¹µ×ÐÔ£¡JAVAÔòÊÇÍêÈ«µÄÃæÏò¶ÔÏóÓïÑÔ£¬Ëü¾ä·¨¸üÇåÎú£¬¹æÄ£¸üС£¬¸üÒ×ѧ¡£ËüÊÇÔÚ¶Ô¶àÖÖ³ÌÐòÉè¼ÆÓïÑÔ½øÐÐÁËÉîÈëϸÖÂÑо¿µ ......
¹¤×÷µØµã
£ºº¼ÖÝ
ְλ
£ºJava¿ª·¢¹¤³Ìʦ£¨°¢Àï°Í°Í¼¯ÍÅB2B¹«Ë¾ÍøÕ¾¼¼Êõ²¿£©
ÓÐÒâÕßÇë°Ñ¼òÀú·¢¸ømadding.lip@alibaba-inc.com£¡
1£©ºÏÊÊÕßÎÒÃÇ»áÏȽøÐÐµç»°ÃæÊÔ
2£©Í¨¹ýÕßÔÙµ±ÃæÔ¼¼û£¬ÐÎʽͨ³£Îª¶à¶ÔÒ»
ÓÐÒâÕßÇë·¢Óʼþ¸øÎÒ£¬×¢Ã÷µç»°µÈ»ù±¾ÁªÏµÐÅÏ¢¡£ ......
JAVAºìºÚÊ÷
¸ÅÄÿ¸ö½Úµã¶¼´øÓÐÑÕÉ«ÊôÐԵĶþ²æ²éÕÒÊ÷£¬ÑÕÉ«»òºìÉ«»òºÚÉ«;
ÌØÐÔ£º
ÐÔÖÊ1. ½ÚµãÊǺìÉ«»òºÚÉ«¡£
¡¡¡¡ÐÔÖÊ2. ¸ùÊǺÚÉ«¡£
¡¡¡¡ÐÔÖÊ3. ÿ¸öºìÉ«½ÚµãµÄÁ½¸ö×ӽڵ㶼ÊǺÚÉ«¡£(´Óÿ¸öÒ¶×Óµ½¸ùµÄËùÓз¾¶Éϲ»ÄÜÓÐÁ½¸öÁ¬ÐøµÄºìÉ«½Úµã)
¡¡¡¡ÐÔÖÊ4. ´ÓÈÎÒ»½Úµãµ½Æäÿ¸öÒ¶×ÓµÄËùÓз¾¶¶¼°üº¬ÏàͬÊýÄ¿µÄºÚÉ«½Úµã¡£
......
ÒÔǰÔÚ¼ÒÌýÕÅТÏéÀÏʦµÄÊÓÆµÊ±,ÂÅ´ÎÌýµ½ÕÅÀÏʦ½²µ½ÕÆÎÕJAVA»ù´¡¶ÔÓÚÎÒÃÇÒªÀ´´«ÖDzμӾÍÒµÅàѵҪѧϰµÄпγ̵ÄÖØÒª.ÏÖÔÚ¿´À´,ÕâЩ»°ÕæµÄÒ»µã¶¼²»Îª¹ý!ÓÐЩͬѧ»òÐíûÓÐÉî¿ÌÈÏʶÕÅÀÏʦ˵µÄÕâ·¬»°,×Ô¼ºÆ½Ê±¶¯ÊÖÓÖÌ«ÉÙ.¾ÍÄÃÏÖÔÚѧµÄ¾ÍÒµÅàѵ°àµÄ¿Î³ÌÀ´Ëµ,JAVA¿ª·¢ÓõŤ¾ßÏñMYECLIPSEµÈ,ÆäʹÓÃÕæµÄÊÇÈÃÈ˸е½¾ªÏ²,ÒÔǰÕÅÀÏʦÔÚ ......