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 }
  • 相关阅读:
    django全文搜索学习心得(一)haystack 篇
    django request get_full_path 中文问题
    django全文搜索学习心得(五) whoosh 精简版
    django全文搜索学习心得(二)solr 篇
    django全文搜索学习心得(四)sphinx篇
    模拟队列
    差分
    模拟栈
    区间合并
    离散化
  • 原文地址:https://www.cnblogs.com/viven/p/4180417.html
Copyright © 2011-2022 走看看