repl.it
Java

No description

fork
loading
Files
  • Main.java
  • jdt.ls-java-project
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class Main {
  public static void main(String[] args) {
    int count=0;
	int sumof=0;
	int temp;
	for (int i=1; i<=1000; i++){
		sumof=0;
		temp=i;
		while (temp!=0){
			sumof+=temp%10;
			temp/=10;
		}
		if (sumof*6==i)
		count++;
	}
	System.out.print(count);
  }
}
?