Created
July 15, 2011 06:08
-
-
Save 6LYTH3/1084178 to your computer and use it in GitHub Desktop.
git clone - Misspelling [String]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main; | |
import java.io.File; | |
import java.util.Scanner; | |
public class Misspelling { | |
public static void main(String[] args) throws Throwable { | |
File file = new File("txt"); | |
Scanner scan = new Scanner(file); | |
int Tc = 0; | |
for (int i = 0; i <= 1000; i++) { | |
Tc = scan.nextInt(); | |
if (Tc <= 1000 && Tc >= 1) | |
break; | |
} | |
int c = 0; | |
String world = ""; | |
for (int i = 1; i <= Tc; i++) { | |
c = scan.nextInt(); | |
world = scan.next(); | |
StringBuffer Fw = new StringBuffer(world); | |
System.out.println(i + " " + Fw.deleteCharAt(c - 1)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment