import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int sum=0; for (int i = 1; i <= n; i++) if (!(String.valueOf(i).contains("7") || i % 7 == 0)) sum+= i*i; System.out.println(sum); } }
import java.util.*; public class Main { public static void main(String[] args) { Scanner reader = new Scanner(System.in); int n = reader.nextInt(); int sum = 0; for (int i = 0; i <= n; ++i) { if ((i >= 7 && i % 7 == 0) || i % 10 == 7 || i / 10 == 7) { continue; } sum += i*i; } System.out.println(sum); } }
public class Main { public void doSome(int in){ int sum=0; for(int i=1;i<=in;i++){ if(i%7==0||i%10==7||i/10==7){ continue; }else{ sum+=i*i; } } System.out.println(sum); } public static void main(String[] args) { Scanner s=new Scanner(System.in); int input; Main m=new Main(); while(true){ input=s.nextInt(); m.doSome(input); } } }