-
Title Description:
-
The input string s and the character C are required to remove all C characters from S and output the result.
-
Input:
-
The test data has multiple groups, each set of input string s and the character C.
-
Output:
-
For each set of inputs, the output removes the result after the C character.
-
Sample input:
-
Healloa
-
Sample output:
-
Hello
-
Source:
- 2009 The computer Research of Harbin Institute of Technology The real problem
-
FAQ:
Problem solving problems? to discuss the subject of discussion please visit: http://t.jobdu.com/thread-7773-1-1.html
Import java.util.*; public class Main {public static void Test (String str, char c) {for (int i = 0; i < str.length (); i++) { if (Str.charat (i)! = c) { System.out.print (Str.charat (i)); } else continue;} } public static void Main (String args[]) { Scanner cin = new Scanner (system.in); String A; String BB; while (Cin.hasnext ()) { a = Cin.nextline (); bb = Cin.nextline (); Char b = bb.charat (0); Test (A, b); System.out.print ("\ n");}} /************************************************************** problem:1049 user:vhreal Language:java result:accepted time:80 ms memory:15416 kb***************************************** ***********************/
Nine degrees oj-Topic 1049: String to go to a specific character