import java.util.Scanner; publicclass Main {     public static void main(String[] args) {         Solution s = new Solution();         Scanner sc = new Scanner(System.in);         int t = sc.nextInt();         for(int i = 0; i < t; i++) {             long num = sc.nextLong();             s.getResult(num);         }                  sc.close();     } } class Solution {     public void getResult(long num) {         long dig = 0;         long c = 0;         long i = 1;         while(c < num) {             dig++;             c += i <<= 1;         }         c -= i;         c++;                  long s = num - c;         String result = new String();         for(long k = 0; k < dig; k++) {             if((s & 1l) == 1l) {                 result = "7" + result;             } else {                 result = "4" + result;             }             s >>>= 1;         }         System.out.println(result);     }      } 写的很不好(当时很急)
点赞 13

相关推荐

吴offer选手:我卡在笔试才是最好笑的,甚至没给我发过笔试链接
投递哔哩哔哩等公司6个岗位
点赞 评论 收藏
分享

牛客热帖

更多
牛客网
牛客企业服务