.
int a ,b,m;
Scanner s = new Scanner(System.in); System.out.print( \¼üÈëÒ»¸öÕûÊý£º \ a = s.nextInt();
System.out.print( \ÔÙ¼üÈëÒ»¸öÕûÊý£º \ b = s.nextInt();
deff cd = new deff(); m = cd.deff(a,b); int n = a * b / m;
System.out.println(\×î´ó¹«Ô¼Êý: \ System.out.println(\×îС¹«±¶Êý: \} }
class deff{
public int deff(int x, int y) { int t; if(x < y) { t = x; x = y; y = t; }
while(y != 0) {
¿É±à¼
.
if(x == y) return x; else { int k = x % y; x = y; y = k; } } return x; } }
¡¾³ÌÐò7¡¿
ÌâÄ¿£ºÊäÈëÒ»ÐÐ×Ö·û£¬·Ö±ðͳ¼Æ³öÆäÖÐÓ¢ÎÄ×Öĸ¡¢¿Õ¸ñ¡¢Êý×ÖºÍÆäËü×Ö·ûµÄ¸öÊý¡£ import java.util.*; public class lianxi07 {
public static void main(String[] args) { int digital = 0; int character = 0; int other = 0; int blank = 0; char[] ch = null;
Scanner sc = new Scanner(System.in); String s = sc.nextLine();
¿É±à¼
.
ch = s.toCharArray();
for(int i=0; i
} else if((ch >= 'a' && ch <= 'z') || ch > 'A' && ch <= 'Z') { character ++; } else if(ch == ' ') { blank ++; } else { other ++; } }
System.out.println(\Êý×Ö¸öÊý: \ System.out.println(\Ó¢ÎÄ×Öĸ¸öÊý: \ System.out.println(\¿Õ¸ñ¸öÊý: \ System.out.println(\ÆäËû×Ö·û¸öÊý:\ } }
¡¾³ÌÐò8¡¿
ÌâÄ¿£ºÇós=a+aa+aaa+aaaa+aa...aµÄÖµ£¬ÆäÖÐaÊÇÒ»¸öÊý×Ö¡£2+22+222+2222+22222(´Ëʱ¹²ÓÐ5¸öÊýÏà¼Ó)£¬¼¸¸öÊýÏà¼ÓÓмüÅÌ¿ØÖÆ¡£ import java.util.*;
¿É±à¼
ÀýÈç.
public class lianxi08 {
public static void main(String[] args) { long a , b = 0, sum = 0;
Scanner s = new Scanner(System.in); System.out.print(\ÊäÈëÊý×ÖaµÄÖµ£º \ a = s.nextInt();
System.out.print(\ÊäÈëÏà¼ÓµÄÏîÊý£º\ int n = s.nextInt(); int i = 0; while(i < n) { b = b + a; sum = sum + b; a = a * 10; ++ i; }
System.out.println(sum); } }
¡¾³ÌÐò9¡¿
ÌâÄ¿£ºÒ»¸öÊýÈç¹ûÇ¡ºÃµÈÓÚËüµÄÒò×ÓÖ®ºÍ£¬Õâ¸öÊý¾Í³ÆÎª \ÍêÊý \¡£ÀýÈç6=1£«2£«3.±à³Ì ÕÒ³ö1000ÒÔÄÚµÄËùÓÐÍêÊý¡£ public class lianxi09 {
¿É±à¼