Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package gyakorlás;
- import java.util.List;
- import java.util.Scanner;
- /**
- *
- * @author csiger479
- */
- public class Gyakorlás {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- Scanner x=new Scanner(System.in);
- System.out.print("Addj meg egy számot: ");
- System.out.print("Addj meg még 1 számot : ");
- long y=x.nextInt(),i;
- long e=x.nextInt(),t;
- System.out.print("Osztói az "+y+" = 1 , ");
- for( i=2;i<y;i++){
- long z=y%i;
- if(z!=0)continue;
- System.out.print(i+" , ");
- }System.out.println(y);
- System.out.print("Osztói az "+e+" = 1 , ");
- for(t=2;t<e;t++){
- long z=e%t;
- if(z!=0)continue;
- System.out.print(t+" , ");
- }System.out.println(e);
- if(e%2 && y%%2){
- long n=e*y;
- System.out.println(n);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement