zoukankan      html  css  js  c++  java
  • IO-01. 表格输出

    本题要求编写程序,按照规定格式输出表格。

    输入格式:

    本题目没有输入。

    输出格式:

    要求严格按照给出的格式输出下列表格:

    ------------------------------------
    Province Area(km2) Pop.(10K)
    ------------------------------------
    Anhui 139600.00 6461.00
    Beijing 16410.54 1180.70
    Chongqing 82400.00 3144.23
    Shanghai 6340.50 1360.26
    Zhejiang 101800.00 4894.00
    ------------------------------------

    Java代码实现:

     1 public class Main {
     2     public static void main(String[] args) {
     3         System.out.println("------------------------------------
    "
     4                 + "Province      Area(km2)   Pop.(10K)
    "
     5                 + "------------------------------------
    "
     6                 + "Anhui         139600.00   6461.00
    "
     7                 + "Beijing        16410.54   1180.70
    "
     8                 + "Chongqing      82400.00   3144.23
    "
     9                 + "Shanghai        6340.50   1360.26
    "
    10                 + "Zhejiang      101800.00   4894.00
    "
    11                 + "------------------------------------");
    12     }
    13 }

     C语言代码实现:

     1 #include <stdio.h>
     2 
     3 int main()
     4 {
     5     printf("------------------------------------
    ");
     6     printf("Province      Area(km2)   Pop.(10K)
    ");
     7     printf("------------------------------------
    ");
     8     printf("Anhui         139600.00   6461.00
    ");
     9     printf("Beijing        16410.54   1180.70
    ");
    10     printf("Chongqing      82400.00   3144.23
    ");
    11     printf("Shanghai        6340.50   1360.26
    ");
    12     printf("Zhejiang      101800.00   4894.00
    ");
    13     printf("------------------------------------
    ");
    14     return 0;
    15 }
  • 相关阅读:
    错误 2 error C2059: 语法错误:“::”
    完全卸载session 所需要的函数
    header("Location:http://www.baidu.com");
    php str_pad() 用法
    php str_pad();
    设计模式系列-01-开篇
    博客园样式的设置系列-01-侧边栏和皮肤的设置
    vs20132015UML系列之-类图
    php获取当前时间和转换格式
    saltstack:multi-master configuration
  • 原文地址:https://www.cnblogs.com/ConciseAaron/p/3769080.html
Copyright © 2011-2022 走看看