2015年1月8日

【java】用javaSE来实现对mysql数据库的增删改查

摘要: 主程序:import Bean.StudentBean;import Impl.StudentImpl;public class T7 { public static void main(String[] args) { StudentImpl stdimp = new StudentImpl()... 阅读全文

posted @ 2015-01-08 16:21 蜘蛛牛牛 阅读(440) 评论(0) 推荐(0) 编辑

2014年12月31日

怎样在mysql官网下载连接java的驱动包,而不是安装文件?

摘要: 首先进入下载地址:http://dev.mysql.com/downloads/connector/,进入的画面如下图:接着点击Connector/J进入下载页面;此时应该注意下面选项;如果在Select Plactform里面选择Microsoft Windows则下载的是安装文件,如果选择Pla... 阅读全文

posted @ 2014-12-31 10:33 蜘蛛牛牛 阅读(388) 评论(0) 推荐(0) 编辑

2014年12月29日

【java】在java中为啥要重写toString 方法?

摘要: 在java中为啥要重写toString 方法?下面我就以一个简单的例子来说明这个把。先定义一个test5类。并写它的get,set方法。package test5;public class Test5 { private String name; private String sex; privat... 阅读全文

posted @ 2014-12-29 14:36 蜘蛛牛牛 阅读(6396) 评论(0) 推荐(2) 编辑

2014年12月23日

【c语言】指针实现数组元素的移位

摘要: 方案一、显示上移位,实际不发生移位。。#include#includevoid main(){ int a[10],i,*p,n; n=4; srand(time()); printf("数组:"); for(i=0;ivoid move(int *pa,int n,int m){ int *p,*... 阅读全文

posted @ 2014-12-23 19:52 蜘蛛牛牛 阅读(1500) 评论(0) 推荐(0) 编辑

2014年12月22日

【c语言】用指针变量输出一维数组中的数据

摘要: #includevoid main(){ int i,*m,a[5]; printf("数组:");//普通方式输出数组的元素 for(i=0;i<5;i++){ a[i]=rand()%100; printf("%-4d",a[i]); } printf("\n"); m=&a;//指针变量... 阅读全文

posted @ 2014-12-22 20:29 蜘蛛牛牛 阅读(1862) 评论(0) 推荐(0) 编辑

2014年12月21日

【c语言】利用指针进行两个数的交换。

摘要: #includevoid swap(int *a,int *b){ int temp; temp=*a; *a=*b; *b=temp;}void main(){ int a,b,*m,*n; a=4; b=5; m=&a; n=&b; printf("a=%d,b=%d\n",a,b); swap... 阅读全文

posted @ 2014-12-21 22:16 蜘蛛牛牛 阅读(1574) 评论(0) 推荐(0) 编辑

【c语言】使用NULL和指针来寻找数组中是否存在指定的数字

摘要: #include#includevoid main(){ int a[5],i,*p; int x=10; srand(time()); printf("input data to array:\n"); for(i=0;i<5;i++){ a[i]=rand()%100; printf("%-... 阅读全文

posted @ 2014-12-21 21:57 蜘蛛牛牛 阅读(473) 评论(0) 推荐(0) 编辑

2014年12月20日

【c语言】利用指针求三个数的最大数和最小数

摘要: 比较费空间的笨方法:#includevoid main(){ int i,j,k,*m,*n,*q,temp; printf("请输入三个数:"); scanf("%d,%d,%d",&i,&j,&k); printf("三个数是:%d,%d,%d\n",i,j,k); m=&i,n=&j,q=&k... 阅读全文

posted @ 2014-12-20 21:59 蜘蛛牛牛 阅读(2880) 评论(0) 推荐(0) 编辑

2014年12月19日

【c语言】统计一个整数所包含的素因子并输出

摘要: #include#includeint prime(int n){ int i; if(n=sqrt(n)){ printf("素数:%d\n",n); return 1; } }void main(){ int i,n,count=0; while(1){ printf("请输入一个整数:"... 阅读全文

posted @ 2014-12-19 20:42 蜘蛛牛牛 阅读(1313) 评论(0) 推荐(0) 编辑

【c语言】比较两个分数的大小

摘要: #includeint divisor(int a,int b){ int temp=1; if(a0){ printf("a/b大于c/d!\n"); } if(m==0){ printf("a/b等于c/d!\n"); } if(m<0){ printf("a/b小于c/d!\n"); ... 阅读全文

posted @ 2014-12-19 20:25 蜘蛛牛牛 阅读(1590) 评论(0) 推荐(0) 编辑

导航