(URI) Números Ímpares - Solução
import java.io.*;
import java.util.*;
class Main {
public static void process() throws NumberFormatException, IOException {
Scanner sc = new Scanner(System.in);
int number = sc.nextInt();
for (int i = 1; i <= number; i+=2) {
System.out.println(i);
}
return;
}
public static void main(String[] args) throws NumberFormatException, IOException {
Main m = new Main();
m.process();
System.exit(0);
}
}
import java.util.*;
class Main {
public static void process() throws NumberFormatException, IOException {
Scanner sc = new Scanner(System.in);
int number = sc.nextInt();
for (int i = 1; i <= number; i+=2) {
System.out.println(i);
}
return;
}
public static void main(String[] args) throws NumberFormatException, IOException {
Main m = new Main();
m.process();
System.exit(0);
}
}
Comments
Post a Comment