zoukankan      html  css  js  c++  java
  • 5.8---像素设定(CC150)

    注意:仔细注意位置。

        public static int[] renderPixel(int[] screen, int x, int y){
            int[] ans = new int[screen.length ];
            int[] tmp = new int[screen.length * 8];
            int t = 0;
            System.out.println(tmp[7]);
            for(int i = 0; i < screen.length; i++){
                String str = Integer.toBinaryString(screen[i]);
                t=i*8;
                for(int j = str.length()-1; j >=0 ; j--){
    
                    tmp[t++] = str.charAt(j)-48;
                }
            }
            for(int i = x; i <= y; i++){
                tmp[i] = 1;
            }
            System.out.println();
            int flag = 0;
            for(int i = 0; i < tmp.length; ){
                int digit = 0;
                for(int j = 0; j < 8; j++){
                    digit = (int) (digit + tmp[i+j] * Math.pow(2, j));
                }        
                ans[flag++] = digit;
                i = i + 8;
            }
            return ans;
        }
  • 相关阅读:
    5/14 补沙
    5/21 购填缝剂
    5/30 购水不漏
    6/1 购防水
    6/4 补防水
    5/21 人工
    5/7 增购电线
    6/2 补防水
    5/4 瓦工进场
    5/31 补瓷砖
  • 原文地址:https://www.cnblogs.com/yueyebigdata/p/5084721.html
Copyright © 2011-2022 走看看