Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package gyakorlás;
  7.  
  8. import java.util.List;
  9. import java.util.Scanner;
  10.  
  11. /**
  12. *
  13. * @author csiger479
  14. */
  15. public class Gyakorlás {
  16.  
  17. /**
  18. * @param args the command line arguments
  19. */
  20. public static void main(String[] args) {
  21. // TODO code application logic here
  22. Scanner x=new Scanner(System.in);
  23. System.out.print("Addj meg egy számot: ");
  24. System.out.print("Addj meg még 1 számot : ");
  25. long y=x.nextInt(),i;
  26. long e=x.nextInt(),t;
  27. System.out.print("Osztói az "+y+" = 1 , ");
  28.  
  29.  
  30.  
  31.  
  32. for( i=2;i<y;i++){
  33. long z=y%i;
  34. if(z!=0)continue;
  35. System.out.print(i+" , ");
  36.  
  37. }System.out.println(y);
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44. System.out.print("Osztói az "+e+" = 1 , ");
  45. for(t=2;t<e;t++){
  46. long z=e%t;
  47. if(z!=0)continue;
  48. System.out.print(t+" , ");
  49.  
  50. }System.out.println(e);
  51.  
  52. if(e%2 && y%%2){
  53. long n=e*y;
  54. System.out.println(n);
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement