String X=" What test is that? this is a....."
1.去掉空格
2. 取子字串4~21
3. this->這, is->是, a->一個, test->嘗試
4. 改大寫
5. 字串反轉
6. 將字串2,4,6,8,10,.....的字元組成一新字串
herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
python pandas對黃金、外匯匯率的爬蟲練習,並使用matplotlib.pyplot的函數plot, scatter做資料視覺化處理,採用numpy的統計函數,分析黃金價格波動與歐元走勢的關聯。
-
Python C C++ 2 pointer速解Leetcode 2337 Move Pieces to Obtain a String 多日Leetcode的問題都可用2-pointer法來解,今日2337. Move Pieces to Obtain a String也不例...
-
你會用C的算子sizeof?
28 則留言:
import java.security.SecureRandom;
public class jimmy12 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數"+count[j]); } }}
import javax.xml.crypto.dsig.spec.XSLTTransformParameterSpec;public class abcd {public static void main(String[] args) { String x=" What test is that? this is a....."; System.out.println(x); x=x.replace(" ",""); System.out.println(x); x=x.substring(4,22); System.out.println(x); x=x.replace("this","這"); x=x.replace("is","是"); x=x.replace("a","一個"); x=x.replace("test","嘗試"); System.out.println(x); x=x.toUpperCase(); System.out.println(x); String a=""; for(int i=x.length()-1;i>0;i--) a+=x.charAt(i); x=a; System.out.print(a); String y=""; for(int j=2;j<a.length()-1;j+=2) y+=a.charAt(j); System.out.println(); System.out.print(y);}}
public class X1211 {
public static void main(String[] args) { String X="What test is that?this is a...."; X=X.replace(" ",""); System.out.println(X); X=X.substring(4,22); System.out.println(X); X=X.replace("this","這"); X=X.replace("is","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); System.out.println(X); X=X.toUpperCase(); System.out.println(X); String X1=new String(new StringBuffer(X).reverse()); String tmp=""; for(int i=X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ X2+=X.charAt(i); } System.out.println(X2); } }
public class ccc29 {
public static void main(String[] args) { String X=" What test is that? this is a....."; X=X.replace(" ", ""); System.out.println(X); System.out.println(X=X.substring(4,22)); X=X.replace("this","這"); X=X.replace("is","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); System.out.println(X); X=X.toUpperCase(); System.out.println(X); String tmp=""; for(int i=X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ X2+=X.charAt(i); } System.out.println(X2); } }
public class ex11 {
public static void main(String[] args) { String X="what test is that? this is a...."; X=X.replace(" ",""); System.out.println(X); X=X.replace("this","這"); X=X.replace("tis","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); System.out.println(X); X=X.toUpperCase(); System.out.println(X); String X1=new String(new StringBuffer(X).reverse()); String tmp=""; for(int i=X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ X2+=X.charAt(i); } System.out.println(X2);
}
}
public class ccc29 {
public static void main(String[] args) { String X=" What test is that? this is a....."; X=X.replace(" ", ""); System.out.println(X); System.out.println(X=X.substring(4,22)); X=X.replace("this","這"); X=X.replace("is","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); System.out.println(X); X=X.toUpperCase(); System.out.println(X); String tmp=""; for(int i=X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ X2+=X.charAt(i); } System.out.println(X2); } }
public class ex2 {
public static void main(String[] args) {
String X=" What test is that? this is a.....";
X=X.replace(" ", "");
System.out.println(X);
X=X.substring(4,22);
System.out.println(X);
X=X.replace("this", "這");
X=X.replace("is", "是");
X=X.replace("a", "一個");
X=X.replace("test", "嘗試");
System.out.println(X);
X=X.toUpperCase();
System.out.println(X);
String tmp="";
for(int i=X.length()-1;i>=0;i--)
tmp+=X.charAt(i);
X=tmp;
System.out.println(X);
String X2="";
for(int i=2;i<X.length();i+=2){
X2+=X.charAt(i);
}
System.out.println(X2);
}}
package zz;
public class z2 {
public static void main(String[] args) { String X=" What test is that? this is a....."; X=X.replace(" ",""); X=X.substring(4,22); X=X.replace("this","這"); X=X.replace("is","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); X=X.toUpperCase(); System.out.println(X); String x1 = new String(new StringBuffer(X).reverse()); String tmp=""; for(int i =X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ X2+=X.charAt(i); } System.out.println(X2); } }
package rpg; public class FHM { public static void main(String[] args) { String x=" What test is that? this is a....."; x=x.replace(" ",""); x=x.substring(4,22); x=x.replace("this","這"); x=x.replace("is","是"); x=x.replace("a","一個"); x=x.replace("test","嘗試"); x=x.toUpperCase();String a; char y[]=x.toCharArray(); String x1=new String(new StringBuffer(x).reverse()); String d=""; for(int i=x.length()-1;i>=0;i--) d+=x.charAt(i); x=d; System.out.println(x); String x2=""; for(int i=2;i
package rpg; public class FHM { public static void main(String[] args) { String x=" What test is that? this is a....."; x=x.replace(" ",""); x=x.substring(4,22); x=x.replace("this","這"); x=x.replace("is","是"); x=x.replace("a","一個"); x=x.replace("test","嘗試"); x=x.toUpperCase();String a; char y[]=x.toCharArray(); String x1=new String(new StringBuffer(x).reverse()); String d=""; for(int i=x.length()-1;i>=0;i--) d+=x.charAt(i); x=d; System.out.println(x); String x2=""; for(int i=2;i
public class ex3 {
public static void main(String[] args) { String X="What test is that?this is a...."; X=X.replace("",""); System.out.println(X); X=X.substring(4, 22); System.out.println(X); X=X.replace("this","這"); X=X.replace("is","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); System.out.println(X); X=X.toUpperCase(); System.out.println(X); String X1=new String(new StringBuffer(X).reverse());//StringBuffer// System.out.println(X1);// String tmp=""; //for loop法 for(int i=X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ X2+=X.charAt(i); } System.out.println(X2); }
}
public class ex3 {
public static void main(String[] args) { String X="What test is that?this is a...."; X=X.replace("",""); System.out.println(X); X=X.substring(4, 22); System.out.println(X); X=X.replace("this","這"); X=X.replace("is","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); System.out.println(X); X=X.toUpperCase(); System.out.println(X); String X1=new String(new StringBuffer(X).reverse());//StringBuffer// System.out.println(X1);// String tmp=""; //for loop法 for(int i=X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ X2+=X.charAt(i); } System.out.println(X2); }
}
public class ex3 {
public static void main(String[] args) { String X="What test is that?this is a...."; X=X.replace("",""); System.out.println(X); X=X.substring(4, 22); System.out.println(X); X=X.replace("this","這"); X=X.replace("is","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); System.out.println(X); X=X.toUpperCase(); System.out.println(X); String X1=new String(new StringBuffer(X).reverse());//StringBuffer// System.out.println(X1);// String tmp=""; //for loop法 for(int i=X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ X2+=X.charAt(i); } System.out.println(X2); }
}
public class ex3 {
public static void main(String[] args) { String X="What test is that?this is a...."; X=X.replace("",""); System.out.println(X); X=X.substring(4, 22); System.out.println(X); X=X.replace("this","這"); X=X.replace("is","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); System.out.println(X); X=X.toUpperCase(); System.out.println(X); String X1=new String(new StringBuffer(X).reverse());//StringBuffer// System.out.println(X1);// String tmp=""; //for loop法 for(int i=X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ X2+=X.charAt(i); } System.out.println(X2); }
}
package hello;
import java.security.SecureRandom;
public class ex2 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
}
public class a02 {
public static void main(String[] args) { String X="What test is that? this is a ...."; X=X.replace("",""); System.out.println(X); X=X.substring(4,22); System.out.println(X); X=X.replace("this","這"); X=X.replace("is","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); System.out.println(X); X=X.toUpperCase(); System.out.println(X); String X1=new String(new StringBuffer(X).reverse());//StringBuffer //System.out,println(X1); // String tmp="";//for loop法 for(int i=X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ } System.out.println(X2); }
}
public class JIM12 {
public static void main(String[] args) { String X="What testis that?this is a..."; X=X replace("",""); System.out.println(X); X=X substring(4,22); System.out.println(x); X=X replace("this","這"); X=X replace("is","是"); X=X replace("a","一個"); X=X replace("test","嘗試") System.out.println(X); X=X toUpperCase(); System.out.println(X); String X1=new String(new string buffer(X).reverse();//stringBuffer// System.out.println(X1);// String tmp""//for loop法 }
}
public class ex4 { static int[]SmallPrime={2,3,5,7};//Math.sqrt(120)=10.xx static boolean isPrime(int N){ for(int i=0;i<SmallPrime.length;i++) if(N==SmallPrime[i]) return true; else if(N%SmallPrime[i]==0) return false; return true; } public static void main(String[] args) { int count=0; for(int i=3; i<=120; i++) { if(isPrime(i)&&isPrime(i+2)) System.out.println((++count)+":("+i+","+(i+2)+")");
}
}
}
public class ex4 { static int[]SmallPrime={2,3,5,7};//Math.sqrt(120)=10.xx static boolean isPrime(int N){ for(int i=0;i<SmallPrime.length;i++) if(N==SmallPrime[i]) return true; else if(N%SmallPrime[i]==0) return false; return true; } public static void main(String[] args) { int count=0; for(int i=3; i<=120; i++) { if(isPrime(i)&&isPrime(i+2)) System.out.println((++count)+":("+i+","+(i+2)+")");
}
}
}
public class ex4 { static int[]SmallPrime={2,3,5,7};//Math.sqrt(120)=10.xx static boolean isPrime(int N){ for(int i=0;i<SmallPrime.length;i++) if(N==SmallPrime[i]) return true; else if(N%SmallPrime[i]==0) return false; return true; } public static void main(String[] args) { int count=0; for(int i=3; i<=120; i++) { if(isPrime(i)&&isPrime(i+2)) System.out.println((++count)+":("+i+","+(i+2)+")");
}
}
}
public class ex4 { static int[]SmallPrime={2,3,5,7};//Math.sqrt(120)=10.xx static boolean isPrime(int N){ for(int i=0;i<SmallPrime.length;i++) if(N==SmallPrime[i]) return true; else if(N%SmallPrime[i]==0) return false; return true; } public static void main(String[] args) { int count=0; for(int i=3; i<=120; i++) { if(isPrime(i)&&isPrime(i+2)) System.out.println((++count)+":("+i+","+(i+2)+")");
}
}
}
public class ex2 { public static void main(String[] args) { String x="What test is that? this is a....."; System.out.println(x=x.replace(" ","")); System.out.println(x.substring(4,22)); x=x.substring(4,22); x=x.replace("this","這"); x=x.replace("a","一個"); x=x.replace("test","嘗試"); x=x.replace("is","是"); System.out.println(x); System.out.println(x.toUpperCase()); x=x.toUpperCase(); String X1=new String(new StringBuffer(x).reverse()); String tmp=""; for(int i=x.length()-1;i>=0;i--) tmp+=x.charAt(i); x=tmp; System.out.println(x); String X2=""; for(int i=2;i<x.length();i+=2){ X2+=x.charAt(i); } System.out.println(X2); }}
public class cccc {
public static void main(String[] args) { String x=" What test is that? this is a....."; x=x.replace(" ", ""); System.out.println(x); x=x.substring(4, 22); System.out.println(x); x=x.replace("this","這" ); x=x.replace("is","是" ); x=x.replace("a","一個" ); x=x.replace("test","嘗試" ); System.out.println(x); x=x.toUpperCase(); System.out.println(x); String z=""; for (int i=x.length()-1;i>=0;i--) z+=x.charAt(i); x=z; System.out.print(x); String zx=""; for(int c=2;c<x.length();c+=2) zx+=x.charAt(c); x=zx; }}
public class cccc {
public static void main(String[] args) { String x=" What test is that? this is a....."; x=x.replace(" ", ""); System.out.println(x); x=x.substring(4, 22); System.out.println(x); x=x.replace("this","這" ); x=x.replace("is","是" ); x=x.replace("a","一個" ); x=x.replace("test","嘗試" ); System.out.println(x); x=x.toUpperCase(); System.out.println(x); String z=""; for (int i=x.length()-1;i>=0;i--) z+=x.charAt(i); x=z; System.out.print(x); String zx=""; for(int c=2;c<x.length();c+=2) zx+=x.charAt(c); x=zx; }}
public static void main(String[] args) { String X=" What test is that? this is a....."; X=X.replace(" ",""); X=X.substring(4,22); X=X.replace("this","這"); X=X.replace("is","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); X=X.toUpperCase(); System.out.println(X); String x1 = new String(new StringBuffer(X).reverse()); String tmp=""; for(int i =X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ X2+=X.charAt(i); } System.out.println(X2); } }
public class ex3 {
public static void main(String[] args) { String X="What test is that?this is a...."; X=X.replace("",""); System.out.println(X); X=X.substring(4, 22); System.out.println(X); X=X.replace("this","這"); X=X.replace("is","是"); X=X.replace("a","一個"); X=X.replace("test","嘗試"); System.out.println(X); X=X.toUpperCase(); System.out.println(X); String X1=new String(new StringBuffer(X).reverse());//StringBuffer// System.out.println(X1);// String tmp=""; //for loop法 for(int i=X.length()-1;i>=0;i--) tmp+=X.charAt(i); X=tmp; System.out.println(X); String X2=""; for(int i=2;i<X.length();i+=2){ X2+=X.charAt(i); } System.out.println(X2); }
}
public class ex2 { public static void main(String[] args) { String x="What test is that? this is a....."; System.out.println(x=x.replace(" ","")); System.out.println(x.substring(4,22)); x=x.substring(4,22); x=x.replace("this","這"); x=x.replace("a","一個"); x=x.replace("test","嘗試"); x=x.replace("is","是"); System.out.println(x); System.out.println(x.toUpperCase()); x=x.toUpperCase(); String X1=new String(new StringBuffer(x).reverse()); String tmp=""; for(int i=x.length()-1;i>=0;i--) tmp+=x.charAt(i); x=tmp; System.out.println(x); String X2=""; for(int i=2;i<x.length();i+=2){ X2+=x.charAt(i); } System.out.println(X2); }}
public class ex4 { static int[]SmallPrime={2,3,5,7};//Math.sqrt(120)=10.xx static boolean isPrime(int N){ for(int i=0;i<SmallPrime.length;i++) if(N==SmallPrime[i]) return true; else if(N%SmallPrime[i]==0) return false; return true; } public static void main(String[] args) { int count=0; for(int i=3; i<=120; i++) { if(isPrime(i)&&isPrime(i+2)) System.out.println((++count)+":("+i+","+(i+2)+")");
}
}
}
張貼留言