题解 | #幸运数字7#
幸运数字7
https://ac.nowcoder.com/acm/problem/22162
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int sum = 0;
for(int i = 1; i <= n; i++){
if(i % 7 == 0){
sum += i;
}
}
System.out.println(sum);
}
}