java - exact copy of a string to array string! DPLL algorithm -


I think the solution is very close but I can not find it. I am implementing one type of DPLL algorithm in two ways. The first one that takes input from a file automatically and wants to manually input the other (the same) from the console. The second works well, but first of all there are some problems both of my input are in this form: [-8,6,1] [4, 10, -1] [7, -5,3] [10, -8, 3] [10, -8, -6] [5, -3,6] This class needs to manage the acquisition of files.

  package ausiliare; Import java.io.file; Import java.io.IOException; Import org.apache.commons.io *; // import org.apache.commons.lang3.StringUtils; Public class Letuura {public static entity (iiException throws) {string content = null; File folder = new file ("C: \\ Solution.txt"); Content = FileUtils.readFileToString (folder) + "\ n"; Int = out of integer Parasent (content.substring (0, content.indexOf ("[")). Trim ()); Returning out; } Public static string getString () throws IOException {String content = null; File folder = new file ("C: \\ Solution.txt"); Content = FileUtils.readFileToString (folder) + "\ n"; String remaining string = content.substring (content.indexOf ("["], content.lastIndexOf ("]") + 1); // System.out.println (remaining string); Balance withdrawal string; } Public static string [] arg () throws IOException {strings [strArray = getString ()) Split (""); // Here I do not actually // system.out.printline (Arrays.toString (strrayr)); Return Stray; } This part is not required in other algorithms (where I manually copy the solution) The problem is here:  
  public static zero main (string [] args) {try {list> Clausola & gt; Formula = new linked list & lt; Clausola & gt; (); Int n = Letuara.GetInt (); String [] arg = Lettura.arg (); ParseClauses (formula, RGR, N); System.out.println ("Number one utility utility utility:" + n); System.out.println ("La formula-CNF:" + Lettura.getString ()); Boolean [] solution = solution ddll (n, formula);   

--------------------------------------- ----------------------- (other things)

  public static zero parsed click (list & gt; clausola & gt; ; F, string [] arg, int n) {for (int i = 1; i & lt; arg.length; i ++) {/ code>  

My problem string [] arg = Lettura About .arg () is about. This method does not receive the same input as the manual. I hope to be clear thank you very much! Do not use the string [] array instead of using a four [] array you use the following method:

  string s = "foo"; Four [] charArray = s.toCharyArray ();   

charArray = {f, o, o}

If you just want use a string [] Array, so I will do this:

  string s = "foo"; Four [] charArray = s.toCharArray (); String [] sa = new string [chararer.line]; For (int i = 0; i & lt; sA.length; i ++) {SA = i] = string.whf (charare [ii]); }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -