题解 | #挑7#
挑7
http://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int input = sc.nextInt();
int sum = 0;
for(int i=1;i<=input;i++){
if( i%7==0 || (i+"").contains("7")){
sum ++;
//System.out.println(i);
}
}
System.out.println(sum);
}
}
}