import java.io.*;
import java.util.Scanner;
public class Project4
{
public static void main(String[] args)
throws FileNotFoundException
{
Scanner input = new Scanner(new File("data4.txt"));
PrintWriter out = new PrintWriter(new File("output1.txt"));
out.printf(" Tanner Triggs Project 4\n");
out.printf(" Due 10/18/13 Professor Barker");
y=InputNumber();
int divisor = 2;
ctr = 0;
out.printf("\n For the number %4d the prime factors are", InputNumber);
ctr++;
do
{
int remainder = InputNumber% divisor;
if (remainder = 0)
{
out.print(", " +divisor);
InputNumber = InputNumber/divisor;
}
else
{
divisor++;
}
}while (divisor!=y);
InputNumber = input.nextInt();
out.printf("\n\n%d set of numbers factored" , ctr);
input.close();
out.close();
}
}
问问题
53 次