自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 收藏
  • 关注

原创 CentOS安装mysql总结

前两天时间鼓捣在centOS上安装mysql,并通过自己windows电脑连接进行开发工作,现在做一个总结!1.  使用windows登陆mysql官网(https://dev.mysql.com/downloads/mysql/)下载。选择linux - Generic版本,根据实际情况选择32/64位的包,我这里选择64位。文件名称:mysql-5.7.21-linux-glibc2.12-x...

2018-03-28 22:44:05 250

原创 FileCopy

import java.io.*;public class FileCopy { public static void main(String[] args) { FileInputStream source = null; FileOutputStream destionation = null; try { source = new FileInputStream

2013-10-09 17:37:26 529

转载 99乘法表

public static void print99() { for (int x = 1; x <= 9; x++) { for (int y = 1; y <= x; y++) { System.out.print(y + "*" + x + "=" + y * x + "\t "); } System.out.println(); } }

2013-09-29 14:39:43 422

原创 杨辉三角

int a = 10; int b[][]; b = new int[a][]; for (int i = 1; i <= 10; i++) { b[i - 1] = new int[i]; } for (int j = 0; j < 10; j++) { for (int k = 0; k <= j; k++) { if (j == 0 || k == 0

2013-09-27 16:11:13 401

原创 重载

public class Overload { // 方法重载规则: // 方法名相同,参数(个数,类型,顺序)不同,其他无要求。 // 参数匹配优先级:最佳匹配(类型一致)=>基本类型自动转换=>包装类=>可变参数 public static void main(String[] args) { // TODO Auto-generated method stub Overl

2013-09-27 16:10:14 370

原创 [mess]java基础1234

// 求余%:商必须是整数; 余数=被余数-商*除数; 第一个数字是正数,结果为整数;第一个数字是负数,结果为负数。】        // for while        // int sum = 0;        // for (int i = 1; i         // sum += i;        // }                // su

2013-09-27 16:08:36 696

原创 四章

private static void j4_1() {        int[] a = new int[5];        System.out.println("请依次输入");        Scanner sc = new Scanner(System.in);        for (int i = 0; i             a[i] = sc.nextI

2013-09-27 16:04:42 385

原创 三章

private static void j3_1() { Scanner sc = new Scanner(System.in); int i = sc.nextInt(); int n = i % 2; if (n == 0) { System.out.println("N是偶数"); } else System.out.println("N是奇数"); }

2013-09-27 16:03:30 414

原创 计算每月天数

System.out.println("输入年、月,空格隔开"); Scanner sc = new Scanner(System.in); int y = sc.nextInt(); int m = sc.nextInt(); switch (m) { case 1: case 3: case 5: case 7: case 8: case 10:

2013-09-27 15:56:18 493

原创 大写变小写

char n = 'A'; char n1 = (char) (n + 32); System.out.println(n1);

2013-09-27 15:55:24 449

原创 数组逆序存放

int[] a = new int[5]; Scanner s = new Scanner(System.in); for (int i = 0; i < a.length; i++) { a[i] = s.nextInt(); } for (int i = 0; i < a.length / 2; i++) { int t = a[i]; a[i] = a[

2013-09-27 15:54:28 768

原创 输出Z到A

for (char i = 'Z'; i >= 'A'; i--) { System.out.print(i + " "); }

2013-09-27 15:53:49 889

原创 华氏度、摄氏度互换

System.out.println("输入温度:"); Scanner sc = new Scanner(System.in); double i = sc.nextDouble(); System.out.println("华氏度转摄氏度" + (i - 32) * 5 / 9); System.out.println("摄氏度转华氏度" + i * 9 / 5 + 32);

2013-09-27 15:52:59 600

原创 求三位数各位数字和

int n = 987; int s; s = n / 1000 + n / 100 % 10 + n / 10 % 10 + n % 10; System.out.println(s);

2013-09-27 15:52:04 824

原创 两个数交换的三种实现

int x = 1; int y = 0; int temp; temp = x; x = y; y = temp; System.out.println(x); System.out.println(y); int n = 5; int m = 20; n = n + m; m = n - m; n = n - m; System.out

2013-09-27 15:51:24 571

原创 冒泡排序

int[] a = { 5, 8, 4, 3, 11, 41, 9, 7, 6 }; for (int i = 0; i < a.length - 1; i++) { for (int j = 0; j < a.length - 1 - i; j++) { if (a[j] > a[j + 1]) { int t = a[j]; a[j] = a[j + 1]

2013-09-27 15:50:06 380

原创 猴子分桃

// 海滩上有一堆桃子,五只猴子来分。第一只猴子把这对桃子平均分为无份,多了一个,这只猴子把多的一个扔入海中,拿走了一份。        // 第二只猴子吧剩下的桃子又平均分成五分,又多了一个,它同样把多的一个扔入海中,拿走了一份,第三、第四、第五只猴子都是这样做的。        // 问海滩上原来有多少个桃子?for (int i = 1; i < 10000; i++) {

2013-09-27 15:47:40 384

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除