Uploaded by Yesmukhamedov Yeskendyr

File 25-80

advertisement
/**************************************************************/
43)
import java.io.*;
class Main
{
public static void main(String args[])
throws FileNotFoundException,IOException
{
FileInputStream fis = new FileInputStream(args[0]);
FileOutputStream fos = new FileOutputStream(args[1]);
int b;
while ((b=fis.read()) != -1)
fos.write(b);
fis.close();
fos.close();
}
/**************************************************************/
45)
import java.io.*;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
File temp1 = new File("C:/Users/USER/Desktop/temp1.txt");
File temp2 = new File("C:/Users/USER/Desktop/temp2.txt");
File temp3 = new File("C:/Users/USER/Desktop/temp3.txt");
Scanner scanner1;
PrintWriter pw;
if(temp1.length()>temp2.length() && temp1.length()>temp3.length() ){
scanner1 = new Scanner(temp1);
if(temp2.length()>temp3.length()) {
pw = new PrintWriter(temp3);
}
else{
pw = new PrintWriter(temp2);
}
}
else if(temp2.length()>temp1.length() && temp2.length()>temp3.length() ) {
scanner1 = new Scanner(temp2);
if (temp1.length() > temp3.length()) {
pw = new PrintWriter(temp3);
} else {
pw = new PrintWriter(temp1);
}
}
else{
scanner1 = new Scanner(temp3);
if(temp1.length()>temp2.length()) {
pw = new PrintWriter(temp2);
}
else {
pw = new PrintWriter(temp1);
}
}
while(scanner1.hasNext()){
pw.println(scanner1.nextLine());
}
pw.close();
}
}
/**************************************************************/
Download