import java.util.*;
import java.lang.*;
import java.io.*;
class Main {
public static int clap(int n){
int clap=0;
for(int i=1; i<n+1; i++){
boolean hasSeven=false;
char[] digits=(i+"").toCharArray();
int sum=0;
for(int j=0;j<digits.length;j++){
sum+=digits[j]-'0';
if(digits[j]-'0'==7)
hasSeven=true;
}
if (hasSeven || sum%7==0 || i%7==0){
System.err.println("CLAP - " + i + " contient un 7 ou est divisible par 7 ou la somme de ses digits est divisible par 7");
clap+=1;
}else
System.err.println(i);
}
return clap;
}
public static void main(String[] args) {
System.out.println("Nb de clap : " + clap(89));
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: