日期:2014-05-20 浏览次数:20746 次
public class Exer18
{
static char[] m = {'a','b','c'};
static char[] n = {'x','y','z'};
String str1 = "a VS x";
String str2 = "c VS x";
String str3 = "c VS z";
String str4;
public static void main(String[] args)
{
for (int i = 0; i < m.length; i++)
{
for (int j = 0; j < n.length; j++)
{
str4 = m[i] + " VS " + n[j];
if (str1 == str4 || str2 == str4 || str3 == str4)
{
continue;
}
else
System.out.println(str4);
}
}
}
}
if (str1.equals(str4)
------解决方案--------------------
str2.equals(str4)
------解决方案--------------------
str3.equals(str4))
public class Exer18
{
static char[] m = {'a','b','c'};
static char[] n = {'x','y','z'};
public static void main(String[] args)
{
String str1 = "a VS x";
String str2 = "c VS x";
String str3 = "c VS z";
String str4;
for (int i = 0; i < m.length; i++)
{
for (int j = 0; j < n.length; j++)
{
str4 = m[i] + " VS " + n[j];
if (str1 == str4
------解决方案--------------------