LRUÒ³ÃæÖû»Ë㷨ģÄâJavaʵÏÖ....
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class LRU {
int blockCount;
int seriaCount;
int[] address;
int[] stack;
BufferedReader br;
public static void main(String[] args) {
// int address[] = { 1, 2,3, 2, 8, 4, 3, 9, 4, 1, 2, 4, 6, 8, 2 };
LRU lru = new LRU();
lru.init();
lru.display();
System.out.println("=====LRUÑÝʾËã·¨½áÊø=====");
System.out.println("ϵͳÍ˳ö£¡£¡£¡");
}
public void init() {
try {
br = newBufferedReader(new InputStreamReader(System.in));
} catch (Exception e) {
e.printStackTrace();
System.exit(0);
}
System.out.println("===LRUÒ³ÃæÖû»Ëã·¨ÑÝʾ===");
System.out.println("ÇëÊäÈëÎïÀí¿éÊý:");
blockCount = readInt();
stack = newint[blockCount];
System.out.println("ÇëÊäÈë·ÃÎÊÄÚ´æµÄ¿éÐòÁеĸöÊý:");
seriaCount = readInt();
System.out.println("ÇëÊäÈë·ÃÎÊÄÚ´æµÄ" +seriaCount + "¿éÐòÁÐ,ÖмäÒÑ¿Õ¸ñ·Ö¸ô:");
address = readIntArray();
}
public void display() {
// int[] stack = newint[4];
boolean flag;
System.out.println("µØÖ·ÐòÁУº");
for (int m = 0; m< address.length; m++)
System.out.print(address[m]+ " ");
System.out.print("\n");
System.out.println("Öð´ÎµÄ½»»»Çé¿ö£º");
for (int i = 0; i< address.length; i++) {
int j =0;
flag =false;
int t, temp =address[i];
while(stack[j] != address[i]) {
t= stack[j];
stack[j]= temp;
temp= t;
j++;
if(temp == 0 || j == stack.length)
Ïà¹ØÎĵµ£º
½üÆÚÓиöСCMSÏîÄ¿£¬ÓÉÓÚ·þÎñÆ÷¡¢ÈËÔ±ÒÔ¼°¹ÜÀíÖƶȵÈһϵÁÐÎÊÌ⣬²»µÃ²»²ÉÓÃJava Web+AccessÕâÖÖ²»Âײ»ÀàµÄ×éºÏ½øÐпª·¢£¬ÆÚ¼äÓöµ½ÁËÒ»¸öСÎÊÌ⣬ÄǾÍÊÇÎÄÕÂÄÚÈݲÉÓÃAccessµÄ“±¸×¢”ÀàÐÍ´æȡʱ£¬·¢Éú×Ô¶¯½Ø¶ÏµÄÎÊÌâ¡£Ò²¾ÍÊÇ˵£¬´æ½øÈ¥10000×ÖµÄÎÄÕ£¬Ö»ÄÜÏÔʾ³ö3000 ......
Java³ÌÐòµÄÔ´´úÂëºÜÈÝÒ×±»±ðÈË͵¿´¡£Ö»ÒªÓÐÒ»¸ö·´±àÒëÆ÷£¬ÈκÎÈ˶¼¿ÉÒÔ·ÖÎö±ðÈ˵ĴúÂë¡£±¾ÎÄÌÖÂÛÈçºÎÔÚ²»ÐÞ¸ÄÔÓгÌÐòµÄÇé¿öÏ£¬Í¨¹ý¼ÓÃܼ¼Êõ±£»¤Ô´´úÂë¡£
ΪʲôҪ¼ÓÃÜ£¿
¶ÔÓÚ´«Í³µÄC»òC++Ö®ÀàµÄÓïÑÔÀ´Ëµ£¬ÒªÔÚWebÉϱ£»¤Ô´´úÂëÊǺÜÈÝÒ׵ģ¬Ö»Òª²»·¢²¼Ëü¾Í¿ÉÒÔ¡£Òź¶µÄÊÇ£¬Java³ÌÐòµÄÔ´´úÂëºÜÈÝÒ×±»±ðÈË͵¿´¡£Ö»ÒªÓÐÒ»¸ ......
http://www.cnblogs.com/rookieport/archive/2005/09/05/163393.html
ÁôÏÂÔ´´×÷ÕßµÄÁ´½Ó 10¸öÀý×Ó
ÁíÍ⻹ÓÐһƪ
//ÀûÓà java.awt.Robot ÀàÀ´×Ô¶¯Íê³ÉһЩ¼üÅÌ»òÊó±êµÄ¶¯×÷,ÏÂÃæÊÇÒ»¸öСÀý×Ó
//³ÌÐòÁ÷³Ì:Ä£ÄâÊó±ê×ó¼üµã»÷ ¿ªÊ¼-->ÔËÐÐ-->CMD-->DIR-->CLS-->EXIT
//Ä£ÄâÓÒ¼üµã»÷ Òƶ¯µ½ÓÒϽÇ--&g ......
/////////////////////DogTestDrive/////////////////////
class DogTestDrive {
public static void main(String[] args) {
Dog one = new Dog();
one.size = 70;
Dog two = new Dog();
two.size = 8;
......