Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package garbage;
- public class Garbage {
- public static void main(String[] args) {
- String s = "..........\n..........\n..........\n.......x..\n..........\n..........\n";
- System.out.println(s);
- int x = 0;
- int y = 5;
- int i = 0;
- while (s.charAt(i)!='x' && i < s.length()){
- x++;
- if (s.charAt(i)=='\n'){
- y--;
- x = 0;
- }
- i++;
- }
- System.out.println("[" + x + ", " + y + "]");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement