亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? point24.java

?? 24點 啊啊 啊啊 啊啊 并不比 不必
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:

class point24 
 {
 	int []number=new int [4];							//存放輸入的四個數
 	char []four={'+','-','*','/'};						//存放四種操作符號
 	int [][]allnum=new int[24][4];						//存放四個數的24種排列形式
 	char [][]out=new char[500][11];						//存放所用找到的符合條件的表達式
 	int []type=new int[500];							//指明out數組中表達式是五種形式中的哪一種
 	public  boolean []outmark=new boolean [500];				//標記out數組中的表達式是否輸出
 	char [][]tempout=new char[500][11];					//存放所得表達式的后序形式
 	int index=0;
 	public int howlong=0;										//out數組的游標
 	char []houzhui=new char[11];
 	boolean []already=new boolean[24];
 	public void update(int a[])
 	{
 		number[0]=a[0];
		number[1]=a[1];
		number[2]=a[2];
		number[3]=a[3];
 	}						//存放一個后綴表達式
	public point24()
	{	
		number[0]=1;
		number[1]=1;
		number[2]=1;
		number[3]=1;
	}		//構造函數
	public void quanpailie()
	{		
		allnum[0]=new int[]{number[0],number[1],number[2],number[3]};
		allnum[1]=new int[]{number[0],number[1],number[3],number[2]};
		allnum[2]=new int[]{number[0],number[2],number[1],number[3]};
		allnum[3]=new int[]{number[0],number[2],number[3],number[1]};
		allnum[4]=new int[]{number[0],number[3],number[2],number[1]};
		allnum[5]=new int[]{number[0],number[3],number[1],number[2]};
		
		allnum[6]=new int[]{number[1],number[0],number[2],number[3]};		
		allnum[7]=new int[]{number[1],number[0],number[3],number[2]};
		allnum[8]=new int[]{number[1],number[2],number[0],number[3]};
		allnum[9]=new int[]{number[1],number[2],number[3],number[0]};
		allnum[10]=new int[]{number[1],number[3],number[2],number[0]};
		allnum[11]=new int[]{number[1],number[3],number[0],number[2]};
		
		allnum[12]=new int[]{number[2],number[0],number[1],number[3]};		
		allnum[13]=new int[]{number[2],number[0],number[3],number[1]};
		allnum[14]=new int[]{number[2],number[1],number[0],number[3]};
		allnum[15]=new int[]{number[2],number[1],number[3],number[0]};
		allnum[16]=new int[]{number[2],number[3],number[0],number[1]};
		allnum[17]=new int[]{number[2],number[3],number[1],number[0]};
		
		allnum[18]=new int[]{number[3],number[0],number[2],number[1]};		
		allnum[19]=new int[]{number[3],number[0],number[1],number[2]};
		allnum[20]=new int[]{number[3],number[1],number[2],number[0]};
		allnum[21]=new int[]{number[3],number[1],number[0],number[2]};
		allnum[22]=new int[]{number[3],number[2],number[0],number[1]};
		allnum[23]=new int[]{number[3],number[2],number[1],number[0]};	
		
		for(int i=0;i<24;i++)
			for(int j=0;j<i;j++)
				if(allnum[i][0]==allnum[j][0] && allnum[i][1]==allnum[j][1]&&
				   allnum[i][2]==allnum[j][2]&&allnum[i][3]==allnum[j][3])
					already[i]=true;
	}							//得到全排列
	public int first(char a)
	{
		if(a=='*'||a=='/')
		return 3;
		else if(a=='+'||a=='-')
		return 1;
		else
		{
		System.out.println("this is wrong!");
		return -1;
		}
	}							//設定操作符的優先級
	public void makesmall(int lenth)
	{
	for(int count =0;count<lenth;count++)
	{
		for(int i=0;i<11;i++)
			if(out[count][i]=='('||out[count][i]==')')
				for(int j=i;j<10;j++)
					out[count][j]=out[count][j+1];
		for(int i=0;i<11;i++)
			if(out[count][i]=='('||out[count][i]==')')
				for(int j=i;j<10;j++)
					out[count][j]=out[count][j+1];
		out[count][7]='\0';out[count][8]='\0';
		out[count][9]='\0';out[count][10]='\0';	
	}	
	//	System.out.println(temp);
	}					//表達式去括號
	public boolean isop(char c)
	{
		if(c=='+'||c=='-'||c=='*'||c=='/')
		return true;
		else
		return false;
	}						//判斷是否為操作符
	public void insertleft(int a,int count)
	{
		int temp=0;
		if(a==0)
		{
			for(int i=9;i>=0;i--)
				out[count][i+1]=out[count][i];
			out[count][0]='(';
		}
		else
		{
			temp=0;
			while(!isop(out[count][temp])||a>1)
			{
				if(isop(out[count][temp]))
					a--;
				temp++;
			}
			for(int j=8;j>=temp;j--)
				out[count][j+2]=out[count][j+1];
			out[count][temp+1]='(';
		}
	}			//在當前位置添加'(’			
	public void insertright(int b,int count)
	{
		int temp=0;
		if(b==4)
		{
			temp=0;
			while(out[count][temp]!='\0')
				temp++;
			out[count][temp]=')';			
		}
		else
		{
			temp=0;
			while(!isop(out[count][temp])||b>1)
			{
				if(isop(out[count][temp]))
					b--;
				temp++;
			}
			for(int j=9;j>=temp;j--)
				out[count][j+1]=out[count][j];
			out[count][temp]=')';
		}
	}			//在當前位置添加')’
	public void addthis(int index,int count)
	{
		switch(type[count])
		{
			case 1:							//((a+b)+c)+d
				if(index==1)
					{insertleft(0,count);insertright(2,count);}
				else
					{insertleft(0,count);insertright(3,count);}
				break;			
			case 2:							//(a+(b+c))+d
				if(index==1)
					{insertleft(1,count);insertright(3,count);}
				else
					{insertleft(0,count);insertright(3,count);}
				break;
			case 3:							//(a+b)+(c+d)
				if(index==1)
					{insertleft(0,count);insertright(2,count);}				
				else
					{insertleft(2,count);insertright(4,count);}
				break;
			case 4:							//a+((b+c)+d)
				if(index==1)
					{insertleft(1,count);insertright(3,count);}							
				else
					{insertleft(1,count);insertright(4,count);}	
				break;
			default:						//a+(b+(c+d))
				if(index==1)
					{insertleft(2,count);insertright(4,count);}
				else
					{insertleft(1,count);insertright(4,count);}
		}
	}			//指出括號添加的位置	
	public void makegood(int lenth)
	{
		char []tempop=new char[3];
		int count=0;
		while(count<lenth)
		{
			int tempopindex=0;
			int tempoutindex=0;
			while(tempoutindex<11)
			{
				if(isop(tempout[count][tempoutindex]))
				{
					tempop[tempopindex]=tempout[count][tempoutindex];
					tempopindex++;
				}
				tempoutindex++;
			}
			tempopindex=0;
			switch(type[count])
			{
				case 1:						//((a+b)+c)+d		
					if(first(tempop[0])<first(tempop[1]))
						addthis(1,count);
					if(first(tempop[1])<first(tempop[2]))
					{
						addthis(2,count);
					}
					break;
				case 2:						//(a+(b+c))+d
					if(first(tempop[0])<first(tempop[1])||first(tempop[0])==first(tempop[1])&&(tempop[1]=='-'||tempop[1]=='/'))
						addthis(1,count);
					if(first(tempop[1])<first(tempop[2]))
						addthis(2,count);
					break;
				case 3:						//(a+b)+(c+d)
					if(first(tempop[0])<first(tempop[2]))
						addthis(1,count);
					if(first(tempop[1])<first(tempop[2])||first(tempop[1])==first(tempop[2])&&(tempop[2]=='-'||tempop[2]=='/'))
						addthis(2,count);
					break;
				case 4:						//a+((b+c)+d)
					if(first(tempop[0])<first(tempop[1]))
						addthis(1,count);
					if(first(tempop[1])<first(tempop[2])||first(tempop[1])==first(tempop[2])&&(tempop[2]=='-'||tempop[2]=='/'))
						addthis(2,count);
					break;
				case 5:						//a+(b+(c+d))
					if(first(tempop[0])<first(tempop[1])||first(tempop[0])==first(tempop[1])&&(tempop[1]=='-'||tempop[1]=='/'))
						addthis(1,count);
					if(first(tempop[1])<first(tempop[2])||first(tempop[1])==first(tempop[2])&&(tempop[2]=='-'||tempop[2]=='/'))
						addthis(2,count);
					break;
			}
			count++;
		}
	}					//為沒有括號的表達式添加括號,使表達式正確
	public int length(char [] c)
	{
		int result=0;
		for(int i=0;i<11&&c[i]!='\0';i++)
			result++;
		return result;
	}						//獲得數組長度
	public boolean partsame(char []one,char[] two)
	{
		int len=length(one);
		if(len!=length(two))
			return false;
		if(len==1)
			if(one[0]==two[0])
				return true;
			else return false;
		else if(len==3)
		{
			if(one[2]!=two[2])
				return false;
			if(one[2]=='+'||one[2]=='*')
			{
				if(one[0]==two[0]&&one[1]==two[1]||one[0]==two[1]&&one[1]==two[0])
					return true;
				else return false;
			}
			else if(one[2]=='-'||one[2]=='/')
				if(one[0]==two[0]&&one[1]==two[1])
					return true;
				else return false;
			else
				{
					System.out.println("A op should be here!3333333333"+one[0]+one[1]+one[2]);
					return false;
				}
		}
		else if(len==5)
		{
			if(one[4]!=two[4])
				return false;
			if(one[4]=='+'||one[4]=='*')
			{
				if(isop(one[3])&&isop(two[3]))
				{
					if(one[0]!=two[0])
						return false;
					else
					{
						char[] list1 = {one[1],one[2],one[3],'\0'};
						char[] list2 = {two[1],two[2],two[3],'\0'};
						
						return(partsame(list1,list2));
					}
				}
				else if(!isop(one[3])&&!isop(two[3]))
				{

					if(one[3]!=two[3])
						return false;
					else
					{
						char[] list1 = {one[0],one[1],one[2],'\0'};
						char[] list2 = {two[0],two[1],two[2],'\0'};
						
						return(partsame(list1,list2));
					}
				}
				else if(!isop(one[3])&&isop(two[3]))
				{
					if(one[3]!=two[0])
						return false;
					else
					{
						char[] list1 = {one[0],one[1],one[2],'\0'};
						char[] list2 = {two[1],two[2],two[3],'\0'};
						
						return(partsame(list1,list2));
					}
				}
				else
				{
					if(one[0]!=two[3])
						return false;
					else
					{
						char[] list1 = {one[1],one[2],one[3],'\0'};
						char[] list2 = {two[0],two[1],two[2],'\0'};
						
						return(partsame(list1,list2));
					}
				}
			}
			else if(one[4]=='-'||one[4]=='/')
			{
				if(isop(one[3])&&isop(two[3]))
				{
					if(one[0]!=two[0])
						return false;
					else
					{
						char[] list1 = {one[1],one[2],one[3],'\0'};
						char[] list2 = {two[1],two[2],two[3],'\0'};
						
						return(partsame(list1,list2));
					}
				}
				else if(!isop(one[3])&&!isop(two[3]))
				{

					if(one[3]!=two[3])
						return false;
					else
					{
						char[] list1 = {one[0],one[1],one[2],'\0'};
						char[] list2 = {two[0],two[1],two[2],'\0'};
						
						return(partsame(list1,list2));
					}
				}
				else return false;
			}
			else
			{
				System.out.println("A op should be here!5555555555");
				return false;
			}
		}
		else
		{
			System.out.println("this is not correct len!");
			return false;
		}
	}//比較兩個子串是否相等
	public boolean isone(int count)
	{
		char first,second;
		int i=0;
		while(!isop(tempout[count][i]))
			i++;
		first=tempout[count][i++];
		while(!isop(tempout[count][i]))
			i++;
		second=tempout[count][i];
		if(first==second&&first==tempout[count][6]&&(first=='+'||first=='*'))
		return true;
		else
			return false;
	}
	public int istwo(int count)
	{
		char first,second;
		int i=0;
		while(!isop(tempout[count][i]))
			i++;
		first=tempout[count][i++];
		while(!isop(tempout[count][i]))
			i++;
		second=tempout[count][i];
		
		
		if((first==second||second==tempout[count][6])&&type[count]!=3&&(second=='+'||second=='*'))
		{
			if(first==second)
				return 3;
			else
				return 2;
		}
		if((first==tempout[count][6]||second==tempout[count][6])&&type[count]==3&&(tempout[count][6]=='+'||tempout[count][6]=='*'))
		{
			return 2;
		}
		return 0;
	}

	public boolean issame(int a,int b)
	{
		boolean result=true;
		char []one=new char[6];
		char []two=new char[6];
		int lenone=length(out[a]);
		int lentwo=length(out[b]);
		if(lenone!=lentwo)
			return false;
		for(int i=0;i<11;i++)
		{
			if(out[a][i]!=out[b][i])
			{result = false;break;}
				
		}
		if(result)
			return true;
		if(isone(a)&&isone(b))
		{
			return true;
		}
		if(istwo(a)!=0&&istwo(b)!=0&&tempout[a][6]==tempout[b][6])
		{
			if(istwo(a)!=istwo(b))
				return false;
			if(istwo(a)==3)
			{
				char ma,mb;
				if(isop(tempout[a][5]))
					ma=tempout[a][0];
				else ma=tempout[a][5];
				if(isop(tempout[b][5]))
					mb=tempout[b][0];
				else mb=tempout[b][5];
				if(ma==mb)
					return true;
				else return false;
			}
			else
			{
				char a1,a2,b1,b2;
				if(type[a]!=3)
				{
					if(isop(tempout[a][5]))
					{
						a1=tempout[a][0];
						if(isop(tempout[a][4]))
							a2=tempout[a][1];
						else a2=tempout[a][4];
					}
					else 
					{
						a1=tempout[a][5];
						if(isop(tempout[a][3]))
							a2=tempout[a][0];
						else a2=tempout[a][3];
					}
				}
				else
				{
					if(tempout[a][2]==tempout[a][6])
					{
						a1=tempout[a][0];
						a2=tempout[a][1];
					}
					else
					{
						a1=tempout[a][3];
						a2=tempout[a][4];
					}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人丝袜18视频在线观看| 免费成人av资源网| av在线不卡观看免费观看| 欧美国产精品专区| 成人免费毛片app| 亚洲日本丝袜连裤袜办公室| 色婷婷久久一区二区三区麻豆| 午夜电影一区二区| 精品日韩一区二区三区免费视频| 国产二区国产一区在线观看| 国产精品成人免费精品自在线观看| 91老师国产黑色丝袜在线| 亚洲成人在线免费| wwww国产精品欧美| av在线一区二区三区| 午夜精品一区二区三区免费视频 | 91免费观看视频在线| 一区二区三区不卡视频| 91精品国产福利在线观看| 国产精品一品视频| 一个色综合网站| 日韩欧美一区二区免费| 99久久国产综合精品色伊| 亚洲成人一区二区在线观看| 日韩欧美不卡在线观看视频| 成人h精品动漫一区二区三区| 亚洲与欧洲av电影| 久久久久亚洲蜜桃| 欧美日韩一区不卡| 成人午夜伦理影院| 日本午夜一区二区| 国产精品乱码久久久久久| 欧美巨大另类极品videosbest | 精品国精品国产| 91美女片黄在线观看| 精品亚洲成av人在线观看| 综合色中文字幕| 欧美电视剧在线看免费| 欧美视频一区二区三区在线观看| 国产精品亚洲一区二区三区妖精| 亚洲曰韩产成在线| 国产精品美女久久久久久久久| 91精品国产综合久久精品性色| 成人激情动漫在线观看| 久久se这里有精品| 一卡二卡三卡日韩欧美| 国产精品少妇自拍| 欧美草草影院在线视频| 欧美丰满一区二区免费视频| 色综合视频一区二区三区高清| 国产激情一区二区三区四区| 久久精品久久99精品久久| 亚洲午夜在线视频| 亚洲天堂av一区| 国产日韩高清在线| 久久久久久97三级| 欧美麻豆精品久久久久久| 成人一级片在线观看| 国产呦萝稀缺另类资源| 视频一区国产视频| 亚洲动漫第一页| 玉米视频成人免费看| 亚洲日本丝袜连裤袜办公室| 国产精品午夜免费| 日本一二三不卡| 国产日韩v精品一区二区| 精品sm在线观看| 日韩免费一区二区三区在线播放| 欧美亚洲精品一区| 欧美影片第一页| 欧美色精品在线视频| 91黄视频在线观看| 欧日韩精品视频| 欧美久久久久中文字幕| 中文字幕一区二区三区不卡在线| 日韩欧美国产综合一区| 日韩一级黄色片| 91精品国产综合久久精品性色| 欧美精品vⅰdeose4hd| 欧美精品久久一区二区三区| 欧美绝品在线观看成人午夜影视| 欧美精品免费视频| 欧美一级二级在线观看| 日韩一区二区三区视频在线观看| 欧美一区二区精品久久911| 日韩视频永久免费| 欧美成人一区二区| 欧美成人a在线| 国产午夜亚洲精品羞羞网站| 国产精品国产三级国产专播品爱网 | 色综合激情五月| 欧洲精品视频在线观看| 91免费国产在线观看| 欧美亚洲动漫另类| 91麻豆精品国产无毒不卡在线观看| 日韩女优av电影| 国产蜜臀av在线一区二区三区| 中文字幕在线播放不卡一区| 亚洲午夜电影网| 老司机精品视频在线| 丰满白嫩尤物一区二区| 91福利视频久久久久| 91精品国产福利在线观看| 久久久精品国产免大香伊| 亚洲天天做日日做天天谢日日欢| 亚洲一区二区欧美日韩| 久久国产尿小便嘘嘘| 成人影视亚洲图片在线| 在线观看日韩精品| 欧美电影免费观看高清完整版在 | 蜜桃视频在线一区| 粉嫩aⅴ一区二区三区四区五区| 9i在线看片成人免费| 欧美裸体bbwbbwbbw| 久久久久久久国产精品影院| 亚洲制服丝袜在线| 国产精品一区二区免费不卡 | 极品尤物av久久免费看| 成人精品在线视频观看| 精品视频1区2区3区| 久久美女艺术照精彩视频福利播放| 亚洲视频综合在线| 久久99国产精品久久| 91老师片黄在线观看| 欧美v日韩v国产v| 亚洲美腿欧美偷拍| 国内成人免费视频| 欧美三级电影精品| 国产精品动漫网站| 经典三级在线一区| 51精品久久久久久久蜜臀| 国产精品成人在线观看| 毛片基地黄久久久久久天堂| 一本在线高清不卡dvd| 久久精品免视看| 青青草97国产精品免费观看无弹窗版| 成人性色生活片| 欧美日韩精品免费| 国产成人免费在线视频| 欧美福利视频一区| 亚洲精品第一国产综合野| 国产福利视频一区二区三区| 欧美大尺度电影在线| 午夜欧美一区二区三区在线播放| 99久久久久久| 国产亚洲精久久久久久| 另类中文字幕网| 制服丝袜激情欧洲亚洲| 亚洲国产中文字幕在线视频综合| 91亚洲永久精品| |精品福利一区二区三区| 国产91精品欧美| 日韩欧美激情在线| 日本美女一区二区| 欧美日韩一区 二区 三区 久久精品| 亚洲日本一区二区三区| 99久久精品国产导航| 中文字幕在线一区| 成人激情免费视频| 国产精品福利一区二区| 国产91丝袜在线观看| 久久精品这里都是精品| 国产一区二区三区蝌蚪| 精品国产乱码久久久久久1区2区| 久久99精品久久久久久动态图 | 欧美激情在线一区二区| 国产一区二区三区国产| 久久综合国产精品| 国产在线观看免费一区| 欧美电影免费观看高清完整版在线| 美女在线一区二区| 久久综合色播五月| 国产馆精品极品| 欧美国产日产图区| 91啪在线观看| 亚洲激情自拍偷拍| 欧美人与性动xxxx| 人人精品人人爱| 精品少妇一区二区三区日产乱码| 国产一区在线精品| 欧美激情一区二区在线| caoporen国产精品视频| 亚洲激情男女视频| 欧美蜜桃一区二区三区| 免费在线看成人av| 精品粉嫩超白一线天av| 成人精品国产免费网站| 成人av影院在线| 亚洲欧美偷拍三级| 欧美精品日韩综合在线| 精品一区二区免费在线观看| 国产区在线观看成人精品| 一本高清dvd不卡在线观看| 肉丝袜脚交视频一区二区| 精品国产免费人成电影在线观看四季| 国产不卡一区视频| 亚洲在线视频免费观看| 欧美tickling挠脚心丨vk| 国产69精品久久久久毛片| 一区二区三区产品免费精品久久75|