标签:style blog ar color os sp java for on
描述编写一个程序实现将字符串中的所有"you"替换成"we"
you are what you do
we are what we do
1 import java.text.NumberFormat; 2 import java.util.Arrays; 3 import java.util.Scanner; 4 5 public class Main { 6 public static void main(String[] args) { 7 Scanner scanner=new Scanner(System.in); 8 String s; 9 10 while(scanner.hasNext()){ 11 s=scanner.nextLine(); 12 s=s.replaceAll("you", "we"); 13 14 System.out.println(s); 15 } 16 } 17 }
标签:style blog ar color os sp java for on
原文地址:http://www.cnblogs.com/zqxLonely/p/4132057.html