(URI) Seis Números Ímpares - Solution

import java.io.*;

class Main  {
    public static void process() throws NumberFormatException, IOException {   
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
           
        int num = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = num; count < 6; i++) {
            if (i%2 == 1) {
                count++;
                System.out.println(i);
            }
        }
               
        return;
    }
   
    public static void main(String[] args) throws NumberFormatException, IOException {
        Main m = new Main();
        m.process();

        System.exit(0);
    }
}

Comments

Popular posts from this blog

(Coderbyte) Dash Insert II - Solução

(Coderbyte) Run Length - Solução

(Coderbyte) Counting Minutes I - Solução