Home > Back-end >  Lowercase letters swap output
Lowercase letters swap output

Time:12-23

How to make it can input multiple letters (continue to lose the next enter after converting input alphabetic letters), or there are other good code for

CodePudding user response:

The do while loop

CodePudding user response:


Look at this, and you almost, but this is the input empty character after the input started to switch,

CodePudding user response:

reference 1/f, Java background zhang response:
the do while loop?

What how

CodePudding user response:

 public class Convert {

Public static void main (String [] args) {

Scanner sc=new Scanner(System.in);

While (sc) hasNext ()) {
Convert (sc) nextLine (). The charAt (0));
}
}

Private static void the convert (char) c {
If (c & gt;='a' & amp; & C & lt;='z')
System. The out. Println (char) (c - 32));
Else if (c & gt;='A' & amp; & C & lt;='Z')
System. The out. Println (char) (c + 32));
The else
System. The out. Println (" illegal input ");
}
}


Do you want this? Ideas also do not have what good idea, so the bottom, add a little bit of the blind chicken son input of judgment,
Cattle attracts all this, the client to write their own,
  • Related