java - Why sum doesn't work here? -
Here I am with another basic question, I hope that these questions do not bother anyone following my last question Because they are very basic because they are very basic. First of all, I get the name, then change them as input, then convert them into integers and they need to be consolidated and put them in the equation which this yoga does not work.
Thank you for your time and support.
> Package Love Index; Import java.util.Scanner; Import java.lang.Math; Public class loveindex {public static zero main (string [] args) {scanner scan = new scanner (system.); System.out.println ("test scanner, write something:"); String testi = scan.nextLine (); Testi = testi.toUpperCase (); Four [] ascii1 = testi.to charas (); For (four f: ascii1) {// System.out.println ((int) ch + ""); Int [] a = {(int) ch}; Int All = IntStream.of (A) .sum (); // & gt; & Gt; & Gt; Here it shows an error and quick fix because there is always a big mess ... System.out.println ("zodiac" + a); } System.out.println ("test scanner, write something:"); String testi2 = scan.nextLine (); Testi2 = testi2.toUpperCase (); Four [] ascii2 = testi2.to carrore (); For (four f: ascii2) {System.out.println ((int) ch + ""); } Scan.close (); }}
What are you trying to do?
public static zero main (string [] args) {scanner scan = new scanner (System.in); System.out.println ("test scanner, write something:"); String testi = scan.nextLine (); Testi = testi.toUpperCase (); Four [] ascii1 = testi.to charas (); Int sum = 0; For (four f: ascii1) {sum + = ch; } System.out.println ("Yoga:" + Yoga); Scan.close (); }
In the form of a request, with the current input example:
public static zero main (string [] args) {scanner scan = new scanner (System.in); System.out.println ("test scanner, write something:"); While (scan.hasNext ()) {System.out.println ("test scanner, write something:"); String testi = scan.nextLine (); Testi = testi.toUpperCase (); Four [] ascii1 = testi.to charas (); Int sum = 0; For (four f: ascii1) {sum + = ch; } System.out.println ("Yoga:" + Yoga); } Scan.close (); }
Comments
Post a Comment