NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

// Chuẩn bị: anh/chị in/viết hết nội dung này ra giấy làm "tài liệu"
// Sau khi nhận đề, anh/chị tìm hình nào giống với đề để "chép", không tìm thấy thì .....

////////////////// BẮT ĐẦU LÀM BÀI //////////////////////////////////
// B1: Mở Visual Studio lên và tạo Project Windows Form mới (đừng hỏi mở thế nào, tạo ra sao nhé! ^.^)
// B2: Anh/Chị kéo vào form 1 label, 1 textbox và 1 button
// B3: Anh/Chị click đúp vào button vừa kéo vào trên form, cửa sổ viết code sẽ mở ra.
// B4: Anh/Chị "copy bằng tay" nội dung code trong tại liệu vào
// B5: Click Run (F5) để chạy chương trình
// Thế là anh/chị có 2 điểm rồi nhé! :)

//////////////////////// TÀI LIỆU //////////////////////////////

/////////////////////// 1 //////////////////////////////////////
*
* *
* *
* *
* *
* *
*

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= m; j++) {
s = (Math.Abs(i) == m - Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 2 //////////////////////////////////////
*
* * *
* * * * *
* * * * * * *
* * * * *
* * *
*

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= m; j++) {
s = (Math.Abs(i) <= m - Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}



/////////////////////// 3 //////////////////////////////////////
*
* *
* * *
* * * *
* * * * *

int n = Int32.Parse(textBox1.Text);
String s;
label1.Text = "";
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
s = (i >= j) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 4 //////////////////////////////////////
* * * * *
* * * *
* * *
* *
*
int n = Int32.Parse(textBox1.Text);
String s;
label1.Text = "";
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
s = (i <= j) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 5 //////////////////////////////////////
*
* *
* * *
* * * *
* * * * *

int n = Int32.Parse(textBox1.Text);
String s;
label1.Text = "";
for (int i = 0; i < n; i++) {
for (int j = n; j >= 0; j--) {
s = (i >= j) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 6 //////////////////////////////////////
* * * * *
* * * *
* * *
* *
*

int n = Int32.Parse(textBox1.Text);
String s;
label1.Text = "";
for (int i = 0; i < n; i++) {
for (int j = n; j > 0; j--) {
s = (i < j) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 7 //////////////////////////////////////
*
* *
* * *
* * * *
* * * *
* * *
* *
*
int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= m; j++) {
s = ((i >= j && i <= 0) || (i <= j && i >= 0)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 8 //////////////////////////////////////
*
* *
* * *
* * * *
* * * *
* * *
* *
*

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= m; j++) {
s = ((j >= -i && i <= 0 && j >= 0) || (i >= 0 && j <= 0 && i <= -j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 9 //////////////////////////////////////
* * * * *
* *
*
* *
* * * * *

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= m; j++) {
s = (i == j || i == -j || i == -m || i == m) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 10 //////////////////////////////////////
* *
* * * *
* * *
* * * *
* *

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= m; j++) {
s = (i == j || i == -j || j == -m || j == m) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 11 //////////////////////////////////////
* * * * *
* * *
*
* * *
* * * * *

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= m; j++) {
s = (Math.Abs(i) >= Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 12 //////////////////////////////////////
* *
* * * *
* * * * *
* * * *
* *

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= m; j++) {
s = (Math.Abs(i) <= Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 13 //////////////////////////////////////
* * * * * * *
* * * * * *
* * * *
* *

int n = Int32.Parse(textBox1.Text) - 1;
String s;
label1.Text = "";
for (int i = -n; i <= 0; i++) {
for (int j = -n; j <= n; j++) {
s = (Math.Abs(i) >= n - Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 14 //////////////////////////////////////
* *
* * * *
* * * * * *
* * * * * * *

int n = Int32.Parse(textBox1.Text) - 1;
String s;
label1.Text = "";
for (int i = 0; i <= n; i++) {
for (int j = -n; j <= n; j++) {
s = (Math.Abs(i) >= n - Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 15 //////////////////////////////////////
* * * * * * *
* * * * * *
* * * *
* *
* * * *
* * * * * *
* * * * * * *

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= m; j++) {
s = (Math.Abs(i) >= m - Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 16 //////////////////////////////////////
* * * * * * *
* * * * *
* * *
*

int n = Int32.Parse(textBox1.Text) - 1;
String s;
label1.Text = "";
for (int i = 0; i <= n; i++) {
for (int j = -n; j <= n; j++) {
s = (Math.Abs(i) <= n - Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 17 //////////////////////////////////////
*
* * *
* * * * *
* * * * * * *

int n = Int32.Parse(textBox1.Text) - 1;
String s;
label1.Text = "";
for (int i = -n; i <= 0; i++) {
for (int j = -n; j <= n; j++) {
s = (Math.Abs(i) <= n - Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 18 //////////////////////////////////////
*
* *
* * *
* * * *
* * *
* *
*

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = 0; j <= m; j++) {
s = (Math.Abs(i) <= m - Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 19 //////////////////////////////////////
*
* *
* * *
* * * *
* * *
* *
*

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= 0; j++) {
s = (Math.Abs(i) <= m - Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 20 //////////////////////////////////////
* * * *
* * *
* *
*
* *
* * *
* * * *

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= 0; j++) {
s = (Math.Abs(i) >= m - Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 21 //////////////////////////////////////
* * * *
* * *
* *
*
* *
* * *
* * * *

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = 0; j <= m; j++) {
s = (Math.Abs(i) >= m - Math.Abs(j)) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 22 //////////////////////////////////////
*
* *
* *
* *
* *
* *
*

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= 0; j++) {
s = (Math.Abs(i) == -j || j == -m) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 23 //////////////////////////////////////
*
* *
* *
* *
* *
* *
*

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = 0; j <= m; j++) {
s = (Math.Abs(i) == j || j == m) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 24 //////////////////////////////////////
* * * *
* *
* *
*
* *
* *
* * * *

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = -m; j <= 0; j++) {
s = (Math.Abs(i) == m + j || j == -m || i == -m || i == m) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 25 //////////////////////////////////////
* * * *
* *
* *
*
* *
* *
* * * *

int n = Int32.Parse(textBox1.Text);
int m = n / 2;
String s;
label1.Text = "";
for (int i = -m; i <= m; i++) {
for (int j = 0; j <= m; j++) {
s = (Math.Abs(i) == m - j || i == m || i == -m || j == m) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 26 //////////////////////////////////////
* * * * * * *
* * * *
* * * *
* *

int n = Int32.Parse(textBox1.Text) - 1;
String s;
label1.Text = "";
for (int i = -n; i <= 0; i++) {
for (int j = -n; j <= n; j++) {
s = (-i == n - Math.Abs(j) || Math.Abs(j) == n || i == -n) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}


/////////////////////// 27 //////////////////////////////////////
* *
* * * *
* * * *
* * * * * * *

int n = Int32.Parse(textBox1.Text) - 1;
String s;
label1.Text = "";
for (int i = 0; i <= n; i++) {
for (int j = -n; j <= n; j++) {
s = (i == n - Math.Abs(j) || Math.Abs(j) == n || i == n) ? "* " : " ";
label1.Text += s;
}
label1.Text += "n";
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.