zoukankan      html  css  js  c++  java
  • 作业:12.23

    打印以下图型:
       行i  列j  i与j关系
    ●●●●● 1  5
    ●●●●● 2  5
    ●●●●● 3  5
    ●●●●● 4  5
    ●●●●● 5  5

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 
     6 namespace ConsoleApplication1
     7 {
     8     class Class1
     9     {
    10         //五行五列
    11         static void Main(string[] args)
    12         {
    13             for (int i = 1; i <= 5;i++ )
    14             {
    15                 for (int j = 1; j <= 5;j++ )
    16                 {
    17                     Console.Write("*");
    18                 }
    19                 Console.WriteLine();
    20             }
    21         }
    22     }
    23 }

    ●                1  1  j<=i
    ●●              2  2
    ●●●            3  3
    ●●●●           4  4
    ●●●●●         5  5

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 
     6 namespace ConsoleApplication1
     7 {
     8     class Class2
     9     {
    10         static void Main(string[] args)
    11         {
    12             for (int i = 1; i <= 5;i++ )
    13             {
    14                 for (int j = 1; j <= i;j++ )
    15                 {
    16                     Console.Write("*");
    17                 }
    18                 Console.WriteLine();
    19             }
    20         }
    21     }
    22 }

    ●●●●●         1  5  j<=6-i  
    ●●●●           2  4
    ●●●            3  3
    ●●              4  2
    ●                5  1

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 
     6 namespace ConsoleApplication1
     7 {
     8     class Class3
     9     {
    10         static void Main(string[] args)
    11         {
    12             for (int i = 1; i <= 5;i++ )
    13             {
    14                 for (int j = 1; j <= 6 - i;j++ )
    15                 {
    16                     Console.Write("*");
    17                 }
    18                 Console.WriteLine();
    19             }
    20         }
    21     }
    22 }

    □□□□● 
    □□□●● 
    □□●●● 
    □●●●● 
    ●●●●● 

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 
     6 namespace ConsoleApplication1
     7 {
     8     class Class5
     9     {
    10         static void Main(string[] args)
    11         {
    12             for (int i = 1; i <= 5;i++ )
    13             {
    14                 for (int j = 1; j <= 5 - i;j++ )
    15                 {
    16                     Console.Write(" ");
    17                 }
    18                 for (int m = 1; m <= i;m++ )
    19                 {
    20                     Console.Write("*");
    21                 }
    22                 Console.WriteLine();
    23             }
    24         }
    25     }
    26 }

    □□□□●
    □□□●●●
    □□●●●●●
    □●●●●●●●
    ●●●●●●●●●

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 
     6 namespace ConsoleApplication1
     7 {
     8     class Class4
     9     {
    10         static void Main(string[] args)
    11         {
    12             for (int i = 1; i <= 5;i++ )
    13             {
    14                 for (int m = 1; m <= 5 - i;m++ )
    15                 {
    16                     Console.Write(" ");
    17                 }
    18                 for (int j = 1; j <= (2 * i - 1);j++ )
    19                 {
    20                     Console.Write("*");
    21                 }
    22                 Console.WriteLine();
    23             }
    24         }
    25     }
    26 }
  • 相关阅读:
    只打开一次浏览器,生成html测试报告<小紧张中......>
    hadoop学习第四天-Writable和WritableComparable序列化接口的使用&&MapReduce中传递javaBean的简单例子
    hadoop学习第三天-MapReduce介绍&&WordCount示例&&倒排索引示例
    hadoop学习第二天-了解HDFS的基本概念&&分布式集群的搭建&&HDFS基本命令的使用
    hadoop学习第一天-hadoop初步环境搭建&伪分布式计算配置(详细)
    大三了,写写博客
    方向问题
    第一天注册博客
    jquery跨域请求事例
    ECharts学习记录
  • 原文地址:https://www.cnblogs.com/viven/p/4180417.html
Copyright © 2011-2022 走看看