interface Shape {
double area();
double girth();
}
class Rectangle implements Shape {
int a,b;
public Rectangle(int aa, int bb) {a=aa; b=bb;}
public double area() {return a*b;}
public double girth() {return 2*(a+b);}
}
public class XXK3 {
public static void main(String[] args) {
Shape x;
x=new Rectangle(5,8);
System.out.println(x.area()+", "+x.girth());
}
}
Public class Test {
Public static void main(String[] args) {
Vector teamList = new Vector();
teamList.add("Z");
teamList.add("L");
teamList.add("W");
teamList.remove(0);
teamList.remove(0);
System.out.println(teamList.size()+","+teamList.get(0));
}
}
public class XXK4 {
public static void main(String[] args) {
int [][]a={{2,5,8},{3,6,9},{4,5,6}};
int []b=new int[3];
int i,j;
for(i=0; i<a.length; i++)
for(j=0; j<a[i].length; j++)
b[i]+=a[i][j];
for(i=0; i<b.length; i++)
System.out.print(b[i]+" ");
}
}
class ABC {
String name;
double price;
public ABC(String na, double pr) {name=na; price=pr;}
public int compareTo(ABC x) {
if(name.compareTo(x.name)>0) return 1;
if(name.compareTo(x.name)<0) return -1;
else return 0;
}
}
public class XXK5 {
public static void main(String[] args) {
String []s={"apple", "pear", "tangerme", "banana", "grape"};
double []d={3.8, 2.5, 3.2, 4.3, 5.2};
ABC []ar=new ABC[s.length];
int i,k=0;
for(i=0; i<ar.length; i++)
ar[i]=new ABC(s[i],d[i]);
for(i=1; i<ar.length; i++)
if(ar[i].compareTo(ar[k])>0) k=i;
System.out.println(ar[k].name+" "+ar[k].price);
}
}
public class StackTest {
public static void main(String[] args) {
Stack<Integer> st = new Stack<Integer>();
st.push(new Integer(11));
st.push(new Integer(22));
st.push(new Integer(33));
System.out.println("size is-> "+st.size());
System.out.println("Top is-> "+st.peek());
st.pop();
System.out.println("new Top is-> "+st.peek());
}
}
命题公式┐(P→Q)的主析取范式是P∨┐Q.( )
命题公式┐P∧P的真值是T.( )
设P:昨天下雨,Q:今天下雨.那么命题“昨天下雨,今天仍然下雨”符号化的结果为P∧Q.( )
含有三个命题变项P,Q,R的命题公式P∧Q的主析取范式(P∧Q∧R)∨(P∧Q∧┐R).( )
命题公式P→(Q∨P)的真值是T.( )
命题公式┐P∧(P→┐Q)∨P为永真式.( )
HLS不是基于HTTP进行传输的。()
被称为“原始文献”的文献是()
一些网站对于密码具有一些规则。编写一个方法,检测字符串是否是一个有效密码。
假定密码规则如下:
密码必须至少8 位字符。
密码仅能包含字母和数字。
密码必须包含至少两个数字。
编程提示用户输入一个密码,如果符合规则,则显示Valid Password,否则显示Invalid Password。
5.平面一般力系可以分解为( )。
6.静定结构的几何组成特征是( )。
【考查知识点:函数图像对称性】
奇函数的图像关于原点对称。( )
【考查知识点:导数综合】
下列结论中( )不正确.
【考查知识点:极值】
函数的极值点是( )
12. 建设工程投资控制方法有( )
2.整体护理的特点有:( )
5.临终关怀的任务是( ) 。
7.临终关怀的主要目的是( )。
public static void main(String[] args) {
int x, y=0;
for(x=1; x<5; x++) y+=x*x;
System.out.println("y="+y);
}
public static void main(String[] args) {
int x, y=0;
for(x=1; x<10; x++)
if(x%2==0) y+=x*x;
System.out.println("y="+y);
}
public static void main(String[] args) {
int x=1, y=1;
while(x++<5) y+=x*x;
System.out.println("y="+y);
}
public static void main(String[] args) {
int i=1, s=0;
while(true) {
if(i%2==0) s+=i;
if(i++>=10) break;
}
System.out.println("s="+s);
}
public static void main(String[] args) {
int c0=0, c1=0, c2=0;
for(int x=1; x<=20; x++) {
switch(x%3) {
case 0: c0++; break;
case 1: c1++; break;
case 2: c2++; break;
}
}
System.out.println("c0,c1,c2="+c0+","+c1+","+c2);
}
public class XXK2 {
private int a,b;
public XXK2(int aa, int bb) {a=aa; b=bb;}
public int f1(int x) {
if(x>10) return a+b+3*x;
else return a*b*x;
}
public static void main(String[] args) {
XXK2 x=new XXK2(3,4);
int y=x.f1(8);
System.out.println("y="+y);
}
}
abstract class Shape {
int a,b;
public Shape(int aa, int bb) {a=aa; b=bb;}
abstract public double area();
}
class Rectangle extends Shape {
public Rectangle(int aa, int bb) {super(aa,bb);}
public double area() {return a*b;}
}
class Triangle extends Shape {
public Triangle(int aa, int bb) {super(aa,bb);}
public double area() {return a*b/2;}
}
public class XXK3 {
public static void main(String[] args) {
Shape x,y;
x=new Rectangle(10,20);
y=new Triangle(10,15);
System.out.println(x.area()+", "+y.area());
}
}
public class XXK4 {
public static void main(String[] args) {
int []a={2,5,8,10,15,20};
int s=0;
for(int i=0; i<a.length; i++) s+=a[i];
System.out.println("s="+s);
}
}
public class XXK4 {
public static void main(String[] args) {
String []a={"xxk","weirong","xucong","xuxiaohua","baojuan"};
int m=0;
for(int i=0; i<a.length; i++) {
int n=a[i].length();
if(n>m) m=n;
}
System.out.println("m="+m);
}
}
interface Shape {
double area();
double girth();
}
class Rectangle implements Shape {
int a,b;
public Rectangle(int aa, int bb) {a=aa; b=bb;}
public double area() {return a*b;}
public double girth() {return 2*(a+b);}
}
public class XXK3 {
public static void main(String[] args) {
Shape x;
x=new Rectangle(5,8);
System.out.println(x.area()+", "+x.girth());
}
}
免费的网站请分享给朋友吧