Posts

(UVA) 10188 - Automated Judge Script - Solução

import java.io.*; import java.util.*; class Main {     public static void main(String[] args) throws NumberFormatException, IOException {         Main processando = new Main();         processando.takeInput();                 System.exit(0);     }         void takeInput() throws NumberFormatException, IOException {         String line = "";         StringTokenizer tokenizer = null;                 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));                 int run = 0;         while ((line = br.readLine()) !...

(UVA) 10062 - Tell me the frequencies! - Solução

import java.io.*; import java.util.*; import java.lang.Math; class Main {     public static void main(String[] args) throws NumberFormatException, IOException {         Main processando = new Main();         processando.takeInput();                 System.exit(0);     }         void takeInput() throws NumberFormatException, IOException {         String line = "";         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));                 Map<Integer, Character> ascii = new TreeMap<Integer, Character>();                 ascii.put(32,...

(UVA) 10093 - An Easy Problem! - Solução

import java.io.*; import java.util.*; import java.lang.Math; import java.math.*; class Main {     public static void main(String[] args) throws NumberFormatException, IOException {         Main processando = new Main();         processando.takeInput();                 System.exit(0);     }         void takeInput() throws NumberFormatException, IOException {         String line = "";         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));                         while ((line = br.readLine()) != null) {             //...

(UVA) 10008 - What's Cryptanalysis? - Solução

import java.io.*; import java.util.*; import java.lang.Math; class Main {     public static void main(String[] args) throws NumberFormatException, IOException {         Main processando = new Main();         processando.takeInput();                 System.exit(0);     }         void takeInput() throws NumberFormatException, IOException {         String line = "";         String entrada = "";         StringTokenizer tokenizer = null;                 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));               ...

(UVA) 10189 - Minesweeper - Solução

import java.io.*; import java.util.*; class Main {     public static void main(String[] args) throws NumberFormatException, IOException {         Main processando = new Main();         processando.takeInput();                 System.exit(0);     }     char[][] leMapa(BufferedReader br, int linha, int coluna) throws NumberFormatException, IOException  {         int a;         int b;         char[][] matrizChar = new char[linha][coluna];         char caracter = 'a';         String string1;                 for (a = 0; a < linha; a++) { ...

(UVA) 100 - The 3n + 1 problem - Solução

import java.io.*; import java.util.*; class Main {     public static void main(String[] args) throws NumberFormatException, IOException {         Main processando = new Main();         processando.takeInput();                 System.exit(0);     }     int obtemMaximo(int numMenor, int numMaior) {         int quantidade = 0;         int maior = 0;         int n = 0;                         for(int i = numMenor; i <= numMaior; i++) {             n = i;             while (n != 0) { ...

(UVA) 10115 - Automatic Editing - Solução

import java.io.*; import java.util.*; import java.lang.Math; import java.math.*; class Main {     public static void main(String[] args) throws NumberFormatException, IOException {         Main processando = new Main();         processando.takeInput();                 System.exit(0);     }         void takeInput() throws NumberFormatException, IOException {         String line = "";                 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));                 while ((line = br.readLine()) != null) {             if (...