- 浏览: 103656 次
- 性别:
- 来自: 江西
-
文章列表
#include "stdio.h"
#include "stdlib.h"
#define MAXNUM 100
//两全局变量提供拓扑排序使用
int visited[MAXNUM];
int inDegree[MAXNUM];
/*输入有向图的数据,输出该有向图的拓扑序列
test data 5 4 0 4 2 4 3 3 1 0 3 2 0 2 3 2 1 0 1 -1 -1
input V4 V2 V0 V3 V1
*/
//有向图的结构体
typedef struct
{
int vexnum;
int ...
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "malloc.h"
typedef char DataType;
/*读入二叉树的中序和后序遍历,输出此二叉树的前序遍历和叶子节点个数
测试数据
DGBAECHF
GDBEHFCA
前序遍历:ABDGCF
*/
/*定义二叉树结构体*/
typedef struct tree
{
DataType d;
struct tree *lch ...
#include "stdlib.h"
#include "stdio.h"
/*读入若干整数 以-9999结束,再以从小到大次序输出,每行10个元素*/
typedef struct link
{
int d;
struct link *next;
}Link,*PLink;
void insertSort(PLink *h)
{
PLink f,p;
int n;
if(*h==NULL)
{
*h=(PLink)malloc(sizeof(Link));
(*h)->next=NUL ...
#include "stdio.h"
#include "stdlib.h"
void swap(int a[],int i,int j)
{
int temp;
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
/*选择排序数组实现 每次从无序区里面选择一个最小的数插入到有序区 有序区从0开始即开始无元素*/
void sel ...
#include <stdio.h>
#include <stdlib.h>
#define MAXNUM 40
typedef int DataType;
int visited[MAXNUM]={0};//访问节点标识
int vexInNum[MAXNUM]={0};//统计节点的入度
//无向图 测试数据 8 0 1 0 2 0 3 1 2 1 4 2 5 3 1 3 6 4 0 4 1 4 6 6 4 6 7 7 6 -1 -1
//有向图 测试数据 需是无环图 做拓扑排序 5 2 0 2 1 0 1 0 4 1 3 4 3 -1 ...
#include "stdio.h"
#include "stdlib.h"
#include "malloc.h"
#include "string.h"
typedef char DataType;
//前序输入的测试数据 data ABC***DE*G**F**
//定义二叉树结构体类型
typedef struct btree
{
DataType data;
struct btree *lchild,*rchild;
}BTree,*PTree;
/*层次化初始二叉树 ...
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#define MAX 1000
/* 编一C程序,它能读入两组整数(每组整数都以-9999为结束标记,个数都不大于1000),
并以从小到大的次序输出既在第一组整数中也在第二组整数中的所有整数(同一个整数不能输出两次)。
(输入时,两个相邻的整数用空格隔开)。*/
/*它能读入一串整数(以-9999为结束标记),再以与输入次序相反的次序输出这串整数(输入、出时,两个相邻的整数用空格隔开)*/
typedef ...
我的电脑-管理-本地用户和组-组-ora_dba-属性
看看是不是少了自己的账户,正确如下图
转java中判断字符串是否为数字的三种方法
- 博客分类:
- Java笔记
java中判断字符串是否为数字的三种方法
1.用JAVA自带的函数
public static boolean isNumeric(String str){
for (int i = str.length();--i>=0;){
if (!Character.isDigit(str.charAt(i))){
return false;
}
}
return true;
}
2.用正则表达式
public static boolean isNumeric(String str){
Pattern pattern ...
#include <stdio.h>
#define DataType char
#define StackSize 10
//定义栈
typedef struct
{
DataType data[StackSize];
int top;
}MyStack;
//初始化栈
void initStack(MyStack *s)
{
s->top=-1;
}
//判断栈空
int stackEmpty(MyStack *s)
{
if(s->top==-1)return 1;
return 0;
}
//判断栈满
int ...
开始——运行对话框中输入 (不是在cmd命令行)
1 、先用msiexec /unregserver 停掉windows installer服务。
2 、msiexec.exe /regserver 启用服务
1.首先新建Test.java
public class Test
{
public static void main(String[] args) {
String str = args[0];
System.out.println(str);
}
}
2.javac Test.java
3.jar cvf test.jar Test.class
//更新manifest.mf 将自己写的manifest.mf 放到Test.class目录
内容为 Main-Class: Test<br>注意回车
4.jar umf MANIFEST.MF ...
windows\system32\drivers\etc\services
- 2009-12-05 10:53
- 浏览 1205
- 评论(0)
public class MyTest {
public static void main(String[] args) {
Test t = new Test();
List<Test> list = new ArrayList<Test>();
for (int i = 0; i < 5; i++) {
t.name = String.valueOf(i);
list.add(t);
}
for (int i = 0; i < list.size(); i++) {
System.out.pri ...
- 2009-09-04 14:21
- 浏览 963
- 评论(0)
public class Singleton {
private static Singleton instance = null;
private Singleton(){}
public static synchronized Singleton getInstance(){
if(instance == null){
instance = new Singleton();
}
return instance;
}
}
class Singleton2{
private Singleton2(){}
private static Si ...
- 2009-09-03 11:16
- 浏览 1254
- 评论(0)