Skip to content

Instantly share code, notes, and snippets.

@6LYTH3
Created July 15, 2011 06:08
Show Gist options
  • Save 6LYTH3/1084178 to your computer and use it in GitHub Desktop.
Save 6LYTH3/1084178 to your computer and use it in GitHub Desktop.
git clone - Misspelling [String]
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