未命名 

import java.net.*;

public class TestInet1 {
  public static void main(String argv[]) 
  {
    try {
      InetAddress myip = InetAddress.getLocalHost();

      System.out.println(myip.getHostName());
      System.out.println(myip.getHostAddress());
    } catch (UnknownHostException e) {
      System.out.println("Error: unable to resolve localhost");
    }
  }
}

wadj223436 發表在 痞客邦 留言(0) 人氣()

/**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}

未命名

wadj223436 發表在 痞客邦 留言(0) 人氣()

<html>
<head>
<title> The First Example: Hello, World </title>
</head>
<body>
<h2> This line is HTML </h2>

<script language="JavaScript">
<!--
document.write("Hello, my name is 郭盈成 World.This sentence is written using JavaScript.");
// Text on the right of 2 slashes is comment
/* This is comment
that occur more than 1 line
*/
//-->
</script>
<noscript>
Sorry, but your browser doesn't run JavaScript.
</noscript>

wadj223436 發表在 痞客邦 留言(0) 人氣()

  • Mar 06 Fri 2015 15:12
  • java


class Test
{
public static void main(String[] args)
{
System.out.println("_____*_____");
System.out.println("____***____");
System.out.println("___*****___");
System.out.println("__*******__");
System.out.println("_____*_____");
System.out.println("_____*_____");
}
}

未命名  

wadj223436 發表在 痞客邦 留言(0) 人氣()

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
Button[,] buttons = new Button[4, 4];
Random irand = new Random();
int rd = 0;
public Form1()
{
InitializeComponent();
}

wadj223436 發表在 痞客邦 留言(0) 人氣()

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
Button[,] buttons = new Button[5, 5];
public Form1()
{
InitializeComponent();
}

wadj223436 發表在 痞客邦 留言(0) 人氣()

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
Random rand = new Random();
Button[,] buttons = new Button[5, 5];
public Form1()
{
InitializeComponent();
}

wadj223436 發表在 痞客邦 留言(0) 人氣()

excel 99乘法表

使用EXCEL內建VBA語言寫出陣列格式

wadj223436 發表在 痞客邦 留言(0) 人氣()

判斷三格連線及勝利BOX跳出

int c=0, r;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
button1.Text = "";
button2.Text = "";
button3.Text = "";
button4.Text = "";
button5.Text = "";
button6.Text = "";
button7.Text = "";
button8.Text = "";
button9.Text = "";
}
private void button1_Click(object sender, EventArgs e)
{
c = c + 1;
r = c % 2;
textBox1.Text = Convert.ToString(r);
if (r == 0)
{
button1.Text = "O";
}
else
{
button1.Text = "X";
}
button1.Enabled = false;
}
private void button2_Click(object sender, EventArgs e)
{
c = c + 1;
r = c % 2;
textBox1.Text = Convert.ToString(r);
if (r == 0)
{
button2.Text = "O";
}
else
{
button2.Text = "X";
}
button2.Enabled = false;
judge();
}
private void judge()
{
if( (button1.Text == "X" && button2.Text == "X" && button3.Text == "X")||
(button1.Text == "X" && button5.Text == "X" && button9.Text == "X") ||
(button1.Text == "X" && button4.Text == "X" && button7.Text == "X") ||
(button4.Text == "X" && button5.Text == "X" && button6.Text == "X") ||
(button7.Text == "X" && button8.Text == "X" && button9.Text == "X") ||
(button2.Text == "X" && button5.Text == "X" && button8.Text == "X") ||
(button3.Text == "X" && button6.Text == "X" && button9.Text == "X") ||
(button3.Text == "X" && button5.Text == "X" && button7.Text == "X"))

MessageBox.Show("X贏了");
}
private void button3_Click(object sender, EventArgs e)
{
c = c + 1;
r = c % 2;
textBox1.Text = Convert.ToString(r);
if (r == 0)
{
button3.Text = "O";
}
else
{
button3.Text = "X";
}
button3.Enabled = false;
judge();
}
private void button4_Click(object sender, EventArgs e)
{
c = c + 1;
r = c % 2;
textBox1.Text = Convert.ToString(r);
if (r == 0)
{
button4.Text = "O";
}
else
{
button4.Text = "X";
}
button4.Enabled = false;
judge();
}
private void button5_Click(object sender, EventArgs e)
{
c = c + 1;
r = c % 2;
textBox1.Text = Convert.ToString(r);
if (r == 0)
{
button5.Text = "O";
}
else
{
button5.Text = "X";
}
button5.Enabled = false;
judge();
}
private void button6_Click(object sender, EventArgs e)
{
c = c + 1;
r = c % 2;
textBox1.Text = Convert.ToString(r);
if (r == 0)
{
button6.Text = "O";
}
else
{
button6.Text = "X";
}
button6.Enabled = false;
judge();
}
private void button7_Click(object sender, EventArgs e)
{
c = c + 1;
r = c % 2;
textBox1.Text = Convert.ToString(r);
if (r == 0)
{
button7.Text = "O";
}
else
{
button7.Text = "X";
}
button7.Enabled = false;
judge();
}
private void button8_Click(object sender, EventArgs e)
{
c = c + 1;
r = c % 2;
textBox1.Text = Convert.ToString(r);
if (r == 0)
{
button8.Text = "O";
}
else
{
button8.Text = "X";
}
button8.Enabled = false;
judge();
}
private void button9_Click(object sender, EventArgs e)
{
c = c + 1;
r = c % 2;
textBox1.Text = Convert.ToString(r);
if (r == 0)
{
button9.Text = "O";
}
else
{
button9.Text = "X";
}
button9.Enabled = false;
judge();
}
}
}

wadj223436 發表在 痞客邦 留言(0) 人氣()

 

『目標』做出井字遊戲,判斷三連線及宣告勝利結果。

wadj223436 發表在 痞客邦 留言(0) 人氣()

«12 3