Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class feladat16 {
- public static void main(String[]args) throws IOException, Exception{
- int bekeres;
- int szamok[];
- File fajl=new File("E:\\16javamegoldas.txt");
- FileWriter Kimeneti_stream = new FileWriter(fajl);
- PrintWriter Kimeneti = new PrintWriter(Kimeneti_stream);
- System.out.println("Hánytól írja ki a 3-mal osztható számokat 0-ig? ");
- StreamTokenizer tokenek = new StreamTokenizer(new InputStreamReader(System.in));
- tokenek.nextToken();
- bekeres=(int)tokenek.nval;
- szamok= new int[bekeres];
- for (int i=bekeres; i>=3; i--) {
- if (i % 3 == 0) {
- Kimeneti.println(i);
- System.out.print(i+", ");
- }
- }
- Kimeneti.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement