1. The power of L is 3.41 + the power of 40000l is 1.56. Help me calculate the power of L
Solution, normal calculation, and true calculation, using the infinite approximation method to obtain an approximate value, programming using recursion
Import Java. io. bufferedreader; import Java. io. bufferedwriter; import Java. io. console; import Java. io. file; import Java. io. filereader; import Java. io. filewriter; import Java. util. arraylist; import Java. util. list; public class Io {public static void main (string ARGs []) throws exception {new IO (). operate (1, 1000, 1);} private void operate (double min, double Max, double add) {Boolean bool = true; list <double> List = new arraylist <double> (); List <double> listsub = new arraylist <double> (); double sub = 0; For (double I = min; I <Max; I + = add) {list. add (I); double result = math. pow (I, 3.41) + math. pow (I, 1.56) * 40000; If (sub = math. ABS (result-21780889) <0.001) {bool = false; break;} else {listsub. add (sub) ;}}if (bool) {int Pos = 0; For (Int J = 0; j <listsub. size ()-1; j ++) {pos = J; If (listsub. get (j) <listsub. get (J + 1) {break;} operate (list. get (pos-1), list. get (Pos + 1), add/10);} else {system. out. println ("Final Result:" + list. get (list. size ()-1) + "" + sub );}}}
II,
Import Java. io. bufferedreader; import Java. io. bufferedwriter; import Java. io. console; import Java. io. file; import Java. io. filereader; import Java. io. filewriter; import Java. util. arraylist; import Java. util. list; public class Io {public static void main (string ARGs []) throws exception {string Path = "C: \ weibo.txt"; string content = NULL; string account []; // read the txt; content = new IO (). readtxt (PATH); // show All of the accounts on the screenaccount = content. split ("#"); For (INT I = 0, Len = account. length; I <Len; I ++) {system. out. println (account [I]);} // "" replace # And save in the flodercontent = content. replace ("#", ""); new IO (). writetxt ("C: \ chulihou.txt", content); // chulihou.txt this question is also enough for Nb // Delete the floderfile file = new file (PATH); file. delete ();} private string readtxt (string path) throws exception {Str Ingbuffer string = new stringbuffer (); string temp; bufferedreader in = new bufferedreader (New filereader (PATH); While (temp = in. Readline ())! = NULL) {string. append (temp);} In. close (); Return string. tostring ();} private void writetxt (string path, string content) throws exception {filewriter fw = new filewriter (PATH); bufferedwriter BW = new bufferedwriter (FW); BW. write (content); BW. flush (); BW. close (); FW. close ();}}