package com.test; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); int m = 0; int a= 0; int b= 0; int c= 0; int d= 0; for (int i = 1;i<10000;i++){ if (seven(i)){ m++; int flag = i %4; switch (flag){ case 1:a++; break; case 2:b++; break; case 3:c++; break; case 0:d++; break; } } if (i-m == n){ System.out.println(i-m); break; } } System.out.println(a); System.out.println(b); System.out.println(c); System.out.println(d); } static boolean seven(int i) { if (i%7 == 0){ return true; } while(i>0){ if (i%10 == 7){ return true; } i = i / 10; } return false; } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)