返回列表 發帖
  1. import java.util.Scanner;
  2. import java.io.FileReader;
  3. import java.io.BufferedReader;
  4. public class JP405 {
  5.         public static void main(String args[])
  6.         {
  7.                 Scanner s=new Scanner(System.in);
  8.                 String str;
  9.                 int[] n=new int[3];
  10.                 for(int i=0; i<=2; i++)
  11.                 {
  12.                         n[i]=s.nextInt();
  13.                 }
  14.                 try
  15.                 {
  16.                         BufferedReader br=new BufferedReader(new FileReader("read.txt"));
  17.                         for(int i=0; i<=2; i++)
  18.                         {
  19.                                 str=br.readLine();
  20.                                 for(int j=0; j<str.length(); j++)
  21.                                 {
  22.                                         if(j<n[i])
  23.                                         {
  24.                                                 System.out.print(n[i]);
  25.                                         }
  26.                                         else
  27.                                         {
  28.                                                 System.out.print(str.charAt(j));
  29.                                         }
  30.                                 }
  31.                                 System.out.println();
  32.                         }
  33.                 }
  34.                 catch(Exception e)
  35.                 {
  36.                         System.out.println("error");
  37.                 }
  38.         }
  39. }
複製代碼

TOP

返回列表