⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 习题2-16.java

📁 JAVA用Java和XML建立试题库管理系统,试题库管理系统的设计
💻 JAVA
字号:
class tt
{
	public static void main(String args[])
	{
		String ss="Returns the current capacity of the String buffer. ";
		int n=ss.length();
		StringBuffer sb=new StringBuffer(n);
		int i=0,k,count=0;
		int j=i;
		while(true)
		{
			while(j<n&&!isA_Z(ss.charAt(j)))j++;
			if(j<n)i=j;else break;
			while(j<n&&isA_Z(ss.charAt(j)))j++;
			if(j<n)
			{
				sb.append(ss.substring(i,j)+"\\");
				count++;i=j;
			}
			else
			{
				sb.append(ss.substring(i)+"\\");
				count++;break;				
			}	
		}
        String w[]=new String[count];
        for(k=0,i=0;k<count;k++)
        {
        	j=sb.indexOf("\\",i);
        	w[k]=sb.substring(i,j);
        	i=j+1;
        }
		System.out.println(ss);
		System.out.println(sb);
		for(i=0;i<count;i++)
		   System.out.println(w[i]);
	}
	static boolean isA_Z(char ch)
	{
		if(ch>='A'&&ch<='Z'||ch>='a'&&ch<='z')
		   return true;
		else
		   return false;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -