מועד נבצרים: שאלון

mail@pastecode.io avatar
unknown
java
2 years ago
951 B
3
Indexable
Never
public static void main (String[] args)
	{
		String str = "abcabc";
		System.out.println(isDouble(str));
	}
	public static boolean isDouble(String str){
		String f = str.substring(str.length()/2);
		String l = str.substring(0,str.length()/2);
		if(f.equals(l))
			return true;
		return false;
	}
	//////////////////////////////////////////////////////////////
	java.util.Random
public class main
{
	public static void main (String[] args)
	{
		String str = "abcabc";
		System.out.println(isDouble(str));
	}
	public static boolean isDouble(String str){
		String f = str.substring(str.length()/2);
		String l = str.substring(0,str.length()/2);
		if(f.equals(l))
			return true;
		return false;
	}
	public static PairOfNum[] generate(int n){
        Random rand = new Random();
		PairOfNum [] arr = new PairOfNum[n];
		for(int i =0;i<arr.length;i++){
			arr[i]=getPairONum();
		}
		return arr;
		//UNFINISHED
		
	}
}