Cây thông dấu sao 2

View as PDF



Author:
Problem type
Allowed languages
C++, Clang, Clang++, Cobol, D, Groovy, Haskell, JS, Lua, Node JS, ObjectiveC, Prolog, Python, Scala
Points: 100 (p) Time limit: 1.0s Memory limit: 256M Input: stdin Output: stdout

Dùng lệnh print để in ra hình vẽ sau:

Output

     *    
    * *
   *   *
  *     *
 *       *
***********
     *
     *
     *

Comments


  • -7
    doraemon    12:02 p.m. 7 mar, 2024 edit 6

    This comment is hidden due to too much negative feedback. Click here to view it.

    1 reply

    • 0
      nhatbao09hht    8:25 p.m. 4 nov, 2023
      #include <iostream>
      using namespace std;
      int main()
      {
          for (int i = 1; i <= 6; i++) {
              for (int j = 1; j <= 11; j++)
                  if (i == 6 || i + j == 7 || i - j == -5)
                      cout << "*";
                  else
                      cout << " ";
              cout << endl;
          }
          for (int i = 1; i <= 3; i++) {
              for (int j = 1; j <= 6; j++)
                  if (j == 6)
                      cout << "*";
                  else
                      cout << " ";
              cout << endl;
          }
          return 0;
      }
      

      • 0
        QuynhChi    8:22 a.m. 18 jun, 2023

        mí bạn ơi, cô không cho mình làm theo kiểu thủ công, dùng chục lệnh print. CÓ ai cho mình xin hint được không ạ :>?

        2 replies

        • -2
          ducnamntp    10:23 a.m. 9 jun, 2023

          bruh


          • -2
            chtkiet14    9:18 p.m. 8 feb, 2023

            ảo


            • -3
              SangTheShrimp    8:52 a.m. 7 jan, 2023

              Bruh


              • -6
                hm22_trungnam    6:31 p.m. 3 dec, 2022

                This comment is hidden due to too much negative feedback. Click here to view it.


                • -7
                  tk21phucnguyenxuan    5:51 p.m. 22 oct, 2021

                  This comment is hidden due to too much negative feedback. Click here to view it.