Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static boolean containsEight(String str){
- if (str.contains("8")){
- return true;
- }
- return false;
- }
- public static void main(String[] args) {
- // write your code here
- Scanner scan = new Scanner(System.in);
- System.out.println("Unesite n");
- int n=scan.nextInt();
- for (int i=0;i<=n;i++){
- String pom = i+"";
- if (containsEight(pom)){
- System.out.println(i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement