C#打印九九乘法表

C#打印九九乘法表、、、

----------------------------------

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;   
namespace demo {  
   public class Test {  
                   public static void Main(String [] args) {    
						 for (int i = 1; i < 10; i++) {
						   for (int s = 1; s <= i; s++) {
							 Console.Write(s + "*" + i + "=" + i * s + " ");
							 if (i == s) {
							   Console.Write("\n");
							 }
} } Console.Write("请按任意键急促..........."); Console.ReadKey(); } } }

-----------------------------------------------

-----------------------------------------------

 

using System;  
using System.Collections.Generic;   
namespace demo  
{  
   public class Test  
   {  
                   public static void Main(String [] args)  
                   {  
					   Console.WriteLine("C#C#C#C#C#C#C#C#C#C#C#C#"); 
                            Console.WriteLine("Hello World !");  
							Console.WriteLine("Hello World !");  
							Console.WriteLine("Hello World !");  
							Console.WriteLine("Hello World !");  
							Console.WriteLine("Hello World !");  
						Console.WriteLine("C#C#C#C#C#C#C#C#C#C#C#C#"); 
			//-------------输出乘法口诀:-------------------
			Console.WriteLine("九九乘法表——按回车键继续");//打印表头
            int i;//定义变量i
            int j;//定义变量j
            for (i = 1; i < 10; i++)
            {
                for (j = 1; j <= i; j++)
                {
                    //输入计算公式
                    Console.Write("{0}×{1}={2}\t", j, i, j * i);
                }
                Console.WriteLine();
                Console.ReadLine();
            }
			//-------------输出乘法口诀:-------------------
	   Console.WriteLine("C#C#C#C#C#C#C#C#C#C#C#C#"); 
                            Console.WriteLine("Hello World !");  
							Console.WriteLine("Hello World !");  
							Console.WriteLine("Hello World !");  
							Console.WriteLine("Hello World !");  
							Console.WriteLine("Hello World !");  
						Console.WriteLine("C#C#C#C#C#C#C#C#C#C#C#C#"); 
//-------------输出乘法口诀:-------------------
			Console.WriteLine("九九乘法表——按回车键继续");//打印表头
            int x;//定义变量i
            int y;//定义变量j
            for (x = 1; x < 10; x++)
            {
                for (y = 1; y <= x; y++)
                {
                    //输入计算公式
                    Console.Write("{0}×{1}={2}\t", y, x, y * x);
                }
                Console.WriteLine();
                Console.ReadLine();
            }
			//-------------输出乘法口诀:-------------------
                   }  
   }  
}  

 

 

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
   
namespace demo  
{  
   public class Test1  
   {  
                   public static void Main(String [] args)  
                   {  
                            for (int i = 1; i < 10; i++)
            {
                for (int j = 1; j <= i; j++)
                {
                    Console.Write(string.Format("{0}*{1}={2} ", j, i, i * j));
                }
                Console.WriteLine();
            }
            Console.Read();
         }           
   }  
}  

  

-----------------------------------------------

 

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
   
namespace demo  
{  
   public class Test2  
   {  
                   public static void Main(String [] args)  
                   {  
   
						 for (int i = 1; i < 10; i++) {
						   for (int s = 1; s <= i; s++) {
							 Console.Write(s + "*" + i + "=" + i * s + " ");
							 if (i == s) {
							   Console.Write("\n");
							 }
						   }
						 }
					     Console.Write("请按任意键继续...........");
						 Console.ReadKey();
					
     
                   }  
   }  
}  

  

-----------------------------------------------

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
   
namespace demo  
{  
   public class Test3  
   {  
                   public static void Main(String [] args)  
                   {  
                            Console.WriteLine("Hello World !");  
							 //倒三角
            for (int i = 9; i >= 1; i--)
            {
                for (int j = i; j >= 1; j--)
                {

                    Console.Write("{0}*{1}={2} ", i, j, i * j);  //不换行
                }
                Console.WriteLine(); //换行
            }
            Console.ReadLine();  
                   }  
   }  
}  

  

-----------------------------------------------

 

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
   
namespace demo  
{  
   public class Test4  
   {  
                   public static void Main(String [] args)  
                   {  
                            Console.WriteLine("Hello World !"); 
							for (int i = 1; i <= 9; i++)
            {
                for (int j = 1; j <=i; j++)
                {
                    Console.Write(j+"×"+i+"="+i*j+"\t");
                }
                Console.WriteLine();
            }
Console.Read();
                   }  
   }  
}  

  

-----------------------------------------------

 

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
   
namespace demo  
{  
   public class Test6  
   {  
                   public static void Main(String [] args)  
                   {  
                            Console.WriteLine("Hello World !");  
							  //one  
            Console.WriteLine("        九九乘法表");  
            for (int i = 1; i <= 9; i++) {  
                for (int j = 1; j <= 9; j++) {  
                    Console.Write("{0}*{1}={2,-2} ", i, j, i*j);  
                }  
                Console.WriteLine();  
            }  
  
            //two  
            Console.WriteLine("九九乘法表");  
            for (int i = 1; i <= 9; i++) {  
                for (int j = 1; j <= i; j++) {  
                    Console.Write("{0}*{1}={2,-2} ", i, j, i * j);  
                }  
                Console.WriteLine();  
            }  
  
            //three  
            Console.WriteLine("九九乘法表");  
            for (int i = 1; i <=9; i++) {  
                    for (int k = 0; k < i - 1; k++) {  
                        Console.Write("       ");  
                    }  
                    for (int j = i; j <= 9; j++)  
                    {  
                        Console.Write("{0}*{1}={2,-2} ", i, j, i * j);  
                    }  
                Console.WriteLine();  
            }  
                Console.ReadLine();  
                   }  
   }  
}  

  

-----------------------------------------------

 

 

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
   
namespace demo  
{  
   public class Test7  
   {  
                   public static void Main(String [] args)  
                   {  
                            Console.WriteLine("Hello World !");  
							 int sum=0; //乘积
        for(int i=1;i<10;i++) //乘数
        {
            for(int j=1;j<=i;j++) //被乘数
            {
                sum=i*j;
                Console.Write("{1}*{0}={2}\t",i,j,sum);
            }
			   Console.ReadKey();
                   }  
				    }  
   }  
}  

  

-----------------------------------------------

 

-----------------------------------------------

 

-----------------------------------------------

-----------------------------------------------

-----------------------------------------------

-----------------------------------------------

-----------------------------------------------

 

-----------------------------------------------------------------

转载于:https://www.cnblogs.com/GaoNa/p/9351940.html

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值