import java.util.Scanner;

 public class Solution
 {
     public static void main(String[] args)
     {
         Scanner input = new Scanner(System.in);
         System.out.print("Enter a number between 0 and 511: ");
         int number = input.nextInt();

         input.close();

         char[] chArray = Integer.toBinaryString(number).toCharArray();
         char[][] displayArray = new char[3][3];

         for(int i = 0; i < 3; i++)
         {
             for(int j = 0; j < 3; j++)
             {
                 displayArray[i][j] = chArray[i * 3 + 1];
                 if(displayArray[i][j] == '0')
                     System.out.print('H' + " ");
                 else
                     System.out.print('T' + " ");
             }
             System.out.println();
         }
     }
 }

HW7.11的更多相关文章

  1. 地区sql

    /*Navicat MySQL Data Transfer Source Server : localhostSource Server Version : 50136Source Host : lo ...

  2. WinForm 天猫2013双11自动抢红包【源码下载】

    1. 正确获取红包流程 2. 软件介绍 2.1 效果图: 2.2 功能介绍 2.2.1 账号登录 页面开始时,会载入这个网站:https://login.taobao.com/member/login ...

  3. C++11特性——变量部分(using类型别名、constexpr常量表达式、auto类型推断、nullptr空指针等)

    #include <iostream> using namespace std; int main() { using cullptr = const unsigned long long ...

  4. CSS垂直居中的11种实现方式

    今天是邓呆呆球衣退役的日子,在这个颇具纪念意义的日子里我写下自己的第一篇博客,还望前辈们多多提携,多多指教! 接下来,就进入正文,来说说关于垂直居中的事.(以下这11种垂直居中的实现方式均为笔者在日常 ...

  5. C++ 11 多线程--线程管理

    说到多线程编程,那么就不得不提并行和并发,多线程是实现并发(并行)的一种手段.并行是指两个或多个独立的操作同时进行.注意这里是同时进行,区别于并发,在一个时间段内执行多个操作.在单核时代,多个线程是并 ...

  6. CSharpGL(11)用C#直接编写GLSL程序

    CSharpGL(11)用C#直接编写GLSL程序 +BIT祝威+悄悄在此留下版了个权的信息说: 2016-08-13 由于CSharpGL一直在更新,现在这个教程已经不适用最新的代码了.CSharp ...

  7. ABP(现代ASP.NET样板开发框架)系列之11、ABP领域层——仓储(Repositories)

    点这里进入ABP系列文章总目录 基于DDD的现代ASP.NET开发框架--ABP系列之11.ABP领域层——仓储(Repositories) ABP是“ASP.NET Boilerplate Proj ...

  8. C++11 shared_ptr 智能指针 的使用,避免内存泄露

    多线程程序经常会遇到在某个线程A创建了一个对象,这个对象需要在线程B使用, 在没有shared_ptr时,因为线程A,B结束时间不确定,即在A或B线程先释放这个对象都有可能造成另一个线程崩溃, 所以为 ...

  9. C++11网络编程

    Handy是一个简洁优雅的C++11网络库,适用于linux与Mac平台.十行代码即可完成一个完整的网络服务器. 下面是echo服务器的代码: #include <handy/handy.h&g ...

随机推荐

  1. 分析jQuery中的each方法

    在看jQuery源码是怎么实现each方法之前,我们看一下js的原生实现. ECMAScript 5为数组定义了一个forEach方法,该方法接受两个参数:第一个参数是要在每一个数组项上运行的函数,第 ...

  2. spoj 379

    题是水题  但丫的题目意思太难懂 .......   英语水平  ...... #include <cstdio> #include <cstring> #include &l ...

  3. Oracle----dual

    1. dual is a table that contains a single row. 2. The dual table has one VARCHAR2 column named dummy ...

  4. 设置UINavigation的背景图片和背景颜色

    //通过背景图片来设置背景 float systemVersion = [[[UIDevice currentDevice] systemVersion] floatValue]; UIImage * ...

  5. A JSTL primer, Part 2: Getting down to the core

    In the initial article of this series, you got your first look at JSTL. We described the use of its  ...

  6. linux fork函数与vfork函数

    一.fork1. 调用方法#include <sys/types.h>#include <unistd.h> pid_t fork(void);正确返回:在父进程中返回子进程的 ...

  7. _CrtIsValidPointer 问题

    从微软站点: 检查指针有效性下面的示例使用 _CrtIsValidPointer 验证给定的内存范围对于读或写是否有效. _ASSERTE(_CrtIsValidPointer( address, s ...

  8. UrlRewriteFilter 美化器的使用方法 伪静态化的解决方案(转)

    一,URL美化器简介 UrlRewriteFilter是一个用于改写URL的Web过滤器,类似于Apache的mod_rewrite.适用于任何Web应用服务器(如Resin,Orion,Tomcat ...

  9. OSharp框架总体设计

    OSharp框架解说系列(1):总体设计 〇.前言 哈,距离前一个系列<MVC实用构架设计>的烂尾篇(2013年9月1日)已经跨了两个年头了,今天是2015年1月9日,日期已经相映,让我们 ...

  10. spring结合时,web.xml的配置

    <!-- 1. web.xml配置 <context-param> <param-name>webAppRootKey</param-name> <pa ...