编写一个小游戏:把从起始数到100之内的所有的整数中的是7的倍数的和含有7的数字数都剔除掉,打印其它的数;

package arithmetic;

import java.util.Scanner;

import org.junit.Test;

public class Test03 {
	/**
	 * 编写一个小游戏:把从起始数到100之内的所有的整数中的
	 * 是7的倍数的和含有7的数字数都剔除掉,打印其它的数;
	 */
	@Test
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		System.out.println("请输入一个数字:");
		int j = s.nextInt();
		for (int i = j; i <= 100; i++) {
			if((i%7!=0) && (i%10!=7)&&(i/10!=7))
				System.out.print(i+" ");
		}
	}
}
原文地址:https://www.cnblogs.com/TaoLeonis/p/6582230.html