}
/*¡¾³ÌÐò8¡¿ ×÷Õß ÈôË®·ÉÌì
ÌâÄ¿£ºÇós=a+aa+aaa+aaaa+aa...aµÄÖµ£¬ÆäÖÐaÊÇÒ»¸öÊý×Ö¡£ÀýÈç2+22+222+2222+22222(´Ëʱ¹²ÓÐ5¸öÊýÏà¼Ó)£¬¼¸¸öÊýÏà¼ÓÓмüÅÌ¿ØÖÆ¡£ */
/*
* Ëã·¨£º ¶¨ÒåÒ»¸ö±äÁ¿b£¬ ¸³³õֵΪ0£»¶¨ÒåÒ»±äÁ¿sum£¬ ¸³³õֵΪ0£¬ * ½øÈëÑ»·ºó£¬½«a + b µÄÖµ¸³¸øb£¬½«sum + b µÄÖµ¸³¸øsum£» * ͬʱ£¬½«a Ôö¼ÓÊ®±¶£¬ ++ i£» ¼ÌÐøÑ»·£» * Ñ»·½áÊøºó£¬Êä³ösum µÄÖµ¡£ */
package cn.com.flywater.FiftyAlgorthm; import java.util.Scanner; public class EightPlus { static long a = 2, b = 0;
public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); int i = 0; long sum = 0; while(i < n) { b = b + a;
sum = sum + b; a = a * 10; ++ i; }
System.out.println(\ System.out.println(sum); }
}
/*¡¾³ÌÐò9¡¿
ÌâÄ¿£ºÒ»¸öÊýÈç¹ûÇ¡ºÃµÈÓÚËüµÄÒò×ÓÖ®ºÍ£¬Õâ¸öÊý¾Í³ÆΪ \ÍêÊý \¡£ÀýÈç6=1£«2£«3.±à³Ì ÕÒ³ö1000ÒÔÄÚµÄËùÓÐÍêÊý¡£
*/
package cn.com.flywater.FiftyAlgorthm; public class NinthWanshu {
public static void main(String[] args) {
System.out.println(\µ½1000µÄÍêÊýÓУº \ for(int i=1; i<1000; i++) { int t = 0;
for(int j=1; j<= i/2; j++) { if(i % j == 0) {
6
t = t + j;
} }
if(t == i) {
System.out.print(i + \ } }
} }
/*¡¾³ÌÐò10¡¿ ×÷Õß ÈôË®·ÉÌì
ÌâÄ¿£ºÒ»Çò´Ó100Ã׸߶È×ÔÓÉÂäÏ£¬Ã¿´ÎÂäµØºó·´Ìø»ØԸ߶ȵÄÒ»°ë£»ÔÙÂäÏ£¬ ÇóËüÔÚ µÚ10´ÎÂäµØʱ£¬¹²¾¹ý¶àÉÙÃ×£¿µÚ10´Î·´µ¯¶à¸ß£¿ */
package cn.com.flywater.FiftyAlgorthm; public class TenthTreeFall {
static double height = 100; static double distance = 100;
public static void main(String[] args) { for(int i=1; i<10; i++) { distance = distance + height;
height = height / 2; }
System.out.println(\·³Ì£º\ System.out.println(\¸ß¶È£º\}
}
/*¡¾³ÌÐò11¡¿ * ×÷Õß ÈôË®·ÉÌì
ÌâÄ¿£ºÓÐ1¡¢2¡¢3¡¢4¸öÊý×Ö£¬ÄÜ×é³É¶àÉÙ¸ö»¥²»ÏàͬÇÒÎÞÖظ´Êý×ÖµÄÈýλÊý£¿¶¼ÊǶàÉÙ£¿ 1.³ÌÐò·ÖÎö£º¿ÉÌîÔÚ°Ùλ¡¢Ê®Î»¡¢¸öλµÄÊý×Ö¶¼ÊÇ1¡¢2¡¢3¡¢4¡£×é³ÉËùÓеÄÅÅÁкóÔÙÈ¥ µô²»Âú×ãÌõ¼þµÄÅÅÁС£ */
/*Ëã·¨£º3¸öforÑ»·¼ÓÒ»¸öifÓï¾ä£» * */
package cn.com.flywater.FiftyAlgorthm; public class EleventhNumberRange { public static void main(String[] args) { int count = 0;
for(int x=1; x<5; x++) { for(int y=1; y<5; y++) { for(int z=1; z<5; z++) {
7
if(x != y && y != z && x != z) {
count ++;
System.out.print(x*100 + y*10 + z + \ \ if(count % 4 == 0) { System.out.println(); } } } }
}
System.out.println(\¹²ÓÐ\¸öÈýλÊý\}
}
/*¡¾³ÌÐò12¡¿
* ×÷Õß ÈôË®·ÉÌì
ÌâÄ¿£ºÆóÒµ·¢·ÅµÄ½±½ð¸ù¾ÝÀûÈóÌá³É¡£ÀûÈó(I)µÍÓÚ»òµÈÓÚ10ÍòԪʱ£¬½±½ð¿ÉÌá10%£» ÀûÈó¸ßÓÚ10ÍòÔª£¬µÍÓÚ20ÍòԪʱ£¬µÍÓÚ10ÍòÔªµÄ²¿·Ö°´10%Ìá³É£¬¸ßÓÚ10ÍòÔªµÄ²¿·Ö£¬ ¿É¿ÉÌá³É7.5%£»20Íòµ½40ÍòÖ®¼äʱ£¬¸ßÓÚ20ÍòÔªµÄ²¿·Ö£¬
¿ÉÌá³É5%£»40Íòµ½60ÍòÖ®¼äʱ¸ßÓÚ40ÍòÔªµÄ²¿·Ö£¬¿ÉÌá³É3%£»
60Íòµ½100ÍòÖ®¼äʱ£¬¸ßÓÚ60ÍòÔªµÄ²¿·Ö£¬¿ÉÌá³É1.5%£¬¸ßÓÚ100ÍòԪʱ£¬³¬¹ý100ÍòÔªµÄ²¿·Ö°´1%Ìá³É£¬
´Ó¼üÅÌÊäÈëµ±ÔÂÀûÈóI£¬ÇóÓ¦·¢·Å½±½ð×ÜÊý£¿
1.³ÌÐò·ÖÎö£ºÇëÀûÓÃÊýÖáÀ´·Ö½ç£¬¶¨Î»¡£×¢ÒⶨÒåʱÐè°Ñ½±½ð¶¨Òå³É³¤ÕûÐÍ¡£
*/
/*×¢Ò⣺ Òª¾«È·µ½Ð¡Êýµãºó¶àÉÙ룬Óà DecimalFormat df = new DecimalFormat(\*
*/
package cn.com.flywater.FiftyAlgorthm; import java.text.DecimalFormat; import java.util.*;
public class TwelfthProfitAward { static double profit = 0; static double award = 0;
public static void main(String[] args) { Scanner s = new Scanner(System.in);
profit = s.nextInt();
System.out.println(\ÊäÈëµÄÀûÈóÊÇ\Íò\ if(profit > 0 && profit <= 10) { award = profit * 0.1;
} else if(profit > 10 && profit <= 20) {
award = 10 * 0.1 + (profit - 10) * 0.075; } else if(profit > 20 && profit <= 40) {
award = 10 * 0.1 + 10 * 0.075 + (profit - 20) * 0.05;
8
} else if(profit > 40 && profit <= 60) {
award = 10 * 0.1 + 10 * 0.075 + 20 * 0.05 + (profit - 40) * 0.03; } else if(profit > 60 && profit <= 100) {
award = 20 * 0.175 + 20 * 0.05 + 20 * 0.03 + (profit - 60) * 0.015; } else if(profit > 100) {
award = 20 * 0.175 + 40 * 0.08 + 40 * 0.015 + (profit - 100) * 0.01; }
DecimalFormat df = new DecimalFormat(\
System.out.println(\Ó¦¸ÃÌáÈ¡µÄ½±½ðÊÇ \Íò\} }
/*¡¾³ÌÐò13¡¿ * ×÷Õß ÈôË®·ÉÌì
ÌâÄ¿£ºÒ»¸öÕûÊý£¬Ëü¼ÓÉÏ100ºóÊÇÒ»¸öÍêȫƽ·½Êý£¬ÔÙ¼ÓÉÏ168ÓÖÊÇÒ»¸öÍêȫƽ·½Êý£¬ÇëÎʸÃÊýÊǶàÉÙ£¿
1.³ÌÐò·ÖÎö£ºÔÚ10ÍòÒÔÄÚÅжϣ¬ÏȽ«¸ÃÊý¼ÓÉÏ100ºóÔÙ¿ª·½£¬ÔÙ½«¸ÃÊý¼ÓÉÏ268ºóÔÙ¿ª·½£¬ Èç¹û¿ª·½ºóµÄ½á¹ûÂú×ãÈçÏÂÌõ¼þ£¬¼´Êǽá¹û¡£Çë¿´¾ßÌå·ÖÎö£º */
package cn.com.flywater.FiftyAlgorthm; public class ThirteenthTwiceSqrt {
public static void main(String[] args) { for(long l=1L; l<100000; l++) {
if(Math.sqrt((long)(l+100)) % 1 == 0) { if(Math.sqrt((long)(l+268)) % 1 == 0) {
System.out.println(l + \¼Ó100ÊÇÒ»¸öÍêȫƽ·½Êý£¬ÔÙ¼Ó168ÓÖÊÇÒ»¸öÍêȫƽ·½Êý\ } } }
} }
*¡¾³ÌÐò14¡¿ * ×÷Õß ÈôË®·ÉÌì
ÌâÄ¿£ºÊäÈëijÄêijÔÂijÈÕ£¬ÅжÏÕâÒ»ÌìÊÇÕâÒ»ÄêµÄµÚ¼¸Ì죿 1.³ÌÐò·ÖÎö£ºÒÔ3ÔÂ5ÈÕΪÀý£¬Ó¦¸ÃÏÈ°ÑÇ°Á½¸öÔµļÓÆðÀ´£¬
È»ºóÔÙ¼ÓÉÏ5Ìì¼´±¾ÄêµÄµÚ¼¸Ì죬ÌØÊâÇé¿ö£¬ÈòÄêÇÒÊäÈëÔ·ݴóÓÚ3ʱÐ迼ÂǶà¼ÓÒ»Ìì¡£ */
package cn.com.flywater.FiftyAlgorthm; import java.util.Scanner; import java.io.*;
public class FourteenthYearMonthDay { public static void main(String[] args) { int year, month, day;
9
int days = 0;
int d = 0;
FourteenthYearMonthDay fymd = new FourteenthYearMonthDay();
System.out.print(\ year =fymd.input();
System.out.print(\ month = fymd.input();
System.out.print(\ day = fymd.input();
if (year < 0 || month < 0 || month > 12 || day < 0 || day > 31) { System.out.println(\, please run this program again!\ System.exit(0);
}
for (int i=1; i if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)) { days = 29; } else { days = 28; } //d += days; break; 10