zoukankan      html  css  js  c++  java
  • 语句的应用

     //去几个人            

    //for (int a = 0; a <= 1; a++)            

    //{            

    //    for (int b = 0; b <= 1; b++)           

      //    {        

         //        for (int c = 0; c <= 1; c++)           

      //        {          

       //            for (int d = 0; d <= 1; d++)          

       //            {         

        //                for (int e = 0; e <= 1; e++)          

       //                {         

        //                    for (int f = 0; f <= 1; f++)          

       //                    {        

         //                        if (a + b >= 1 && a + d <= 1 && a + e + f == 2 && b + c != 1 && c+d==1 && (d+e == 0 || d == 1))         

        //                     

       {          

       //                            Console.WriteLine("a=" + a + "b=" + b + "c=" + c + "d=" + d + "e=" + e + "f=" + f);           

      //                        }        

         //                    }     

            //                }        

         //            }        

         //        }          

       //    }           

      //}

                //猴子吃桃             //int tz = 1;

                //for (int i = 1; i <= 6; i++)             //{             //    {             //        tz = (tz + 1) * 2;

                //    }             //}             // Console.WriteLine(+tz + "");

                //五个小朋友

                //{             //    for (int i = 1; i <= 5; i++)             //    {             //        int a = 3;

                //        a = a + 2*4;

                //        { Console.WriteLine("第一个小朋友的年龄是:" +a+""); }

                //    }             //}

                //篮球挑起的高度

                //Console.WriteLine("请输入高度");

                //int a = Convert.ToInt32(Console.ReadLine());                         //double gao=5;             //for (int i=1;i<=a;i++)

                //    if (i > 5)             //    { gao = 0; }

                //    else             //    {             //        gao = gao / 2;             //    }

                //{ Console.WriteLine("第" + a + "弹起的高度是:" + gao.ToString()); }

                //{//练习             //Console.WriteLine("请输入一个数:");             //int t = Convert.ToInt32(Console.ReadLine());             //int sum=0;             //for (int i = 1; i <= t; i++)             //{ sum = sum + i; }             //Console.WriteLine(+sum);

                //百马百石

                //for (int d=1;d<=50;d++)             //{             //    for(int x=1;x<=100;x++)             //    {             //        for (int y=1;y<=200;y++)             //        {

                //double a=d*2+x*1+y*0.5;

                //            if (a==100)             //            {Console.WriteLine("大马"+d+"小马"+x+"幼马"+y+"只");}

                //买东西             //for (int a = 1; a <= 10; a++)             //{             //    for (int b = 1; b <= 5; b++)             //    {             //        for (int c = 1; c <= 25; c++)             //        {             //            int d = a * 5 + b * 10 + c * 2;

                //            if (d == 50)             //            {             //                Console.WriteLine("牙刷" + a + "牙膏" + b + "肥皂" + c + "");             //            }             //        }             //    }             //}

                //凑钱

                //for(int i=1;i<=20;i++)             //{             //    for (int j = 1; j <= 10; j++)             //    {             //        for (int k = 1; k <= 4; k++)             //        {             //            int a = i * 1 + j *2 + k * 5;

                //            if (a == 20)             //            { Console.WriteLine("一块" + i + "两块" + j + "五块" + k + ""); }

                //        }             //    }             //}

                //        for (int i=1;i<=1;i++)             //    {             ////            for (int j=1;j<=2;j++)             //        {             ////                for (int k=1;k<=3;k++)             //            {             ////                   for (r=1;r<=4;r++)

                //{   int a=i+k+j+r;

                //        if(a==4)}}}

                //{Console.WriteLine(a);}

              //一百以内所有的偶数

                //for (int i = 0; i <= 100; i++)

                //    if (i % 2 == 0)             //        Console.WriteLine(i);

  • 相关阅读:
    斜率dp cdq 分治
    POJ2449 (k短路)
    BZOJ1576 (最短路+并查集)
    SWUST0249 (凸包面积)
    道路修建 (网络流)
    HDU3930 (原根)
    ZOJ2006 (后缀自动机)
    Codechef2015 May
    后缀自动机
    Digit (数位DP)
  • 原文地址:https://www.cnblogs.com/hansonglin/p/4622906.html
Copyright © 2011-2022 走看看