• 作业: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 }
  • 相关阅读:
    Android系统启动过程分析
    android的logcat 用法整理
    git 使用详解(10) 远程分支
    android的logcat 用法整理
    android Binder工作流程
    android Binder工作流程
    git log 小结
    linux patch 命令小结
    windows 中 \r\n 区别于 类unix中的\n 疑问 迎刃而解
    Mysql Error Code : 1436 Thread stack overrun
  • 原文地址:https://www.cnblogs.com/viven/p/4180417.html
Copyright © 2020-2023  润新知