Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. package com.company;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4.  
  5.  
  6. public class Main {
  7.  
  8. public static void main(String[] args) {
  9. double liczba = 17./13 ;
  10. int[] tablica = new int[100];
  11. double r = liczba;
  12. int n = 0;
  13.  
  14. tablica[0] = (int)liczba;
  15. while (r-tablica[n]>0)
  16. {
  17. r = 1/(r-tablica[n]) ;
  18. n++;
  19. tablica[n]=(int)r;
  20. }
  21.  
  22. for(int i=0 ; i <4 ; i++) {
  23. System.out.println(tablica[i]);
  24. }
  25.  
  26. // write your code here
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement