多使用1. boolean 2. return 3. charAt() 4. import java.util.Scanner; 5. Scanner這幾個語法。
以下解答(乖乖的人不要抄):
package blah.blah;//zerojudge#a224( AC!!! )
import java.util.*;
public class BlahBlah {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
while(input.hasNext()){
String S=input.next();
if(f (S)||S.length()==1)System.out.println("yes !");
else System.out.println("no...");
}
}
static boolean f (String S){
int times=0;
int NumberA []=new int [36];
for(int i=0;i<S.length();i++){
if(65<=S.charAt(i)&&S.charAt(i)<=90) NumberA[S.charAt(i)-65]++;
else if(97<=S.charAt(i)&&S.charAt(i)<=122) NumberA[S.charAt(i)-97]++;
else if(48<=S.charAt(i)&&S.charAt(i)<=57) NumberA[S.charAt(i)-22]++;
}
for(int i=0;i<36;i++) if(NumberA [i]%2==1) times++;
if(times<=1) return true;
return false;}
}
多使用1. boolean 2. return 3. charAt() 4. import java.util.Scanner; 5. Scanner這幾個語法。
以下解答(乖乖的人不要抄):
package blah.blah;//zerojudge#a224( AC!!! )
import java.util.*;
public class BlahBlah {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
while(input.hasNext()){
String S=input.next();
if(f (S)||S.length()==1)System.out.println("yes !");
else System.out.println("no...");
}
}
static boolean f (String S){
int times=0;
int NumberA []=new int [36];
for(int i=0;i<S.length();i++){
if(65<=S.charAt(i)&&S.charAt(i)<=90) NumberA[S.charAt(i)-65]++;
else if(97<=S.charAt(i)&&S.charAt(i)<=122) NumberA[S.charAt(i)-97]++;
else if(48<=S.charAt(i)&&S.charAt(i)<=57) NumberA[S.charAt(i)-22]++;
}
for(int i=0;i<36;i++) if(NumberA [i]%2==1) times++;
if(times<=1) return true;
return false;}
}
blah blah blah