Advertisement
Guest User

Untitled

a guest
Nov 24th, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. public static  void main (String[] args) {System.out.println(Approximation2);}
  2.    
  3.  
  4.    
  5.     int Fakultät_berechnen(int n){
  6.         int fakultät = 1;
  7.  
  8.         if (n == 0){
  9.            
  10.         fakultät = 1;
  11.         }
  12.    
  13.        
  14.         for(int zahl=1; zahl<=n; zahl++){
  15.             fakultät = fakultät * zahl;
  16.            
  17.             }
  18.         return fakultät;
  19.     }
  20.     int EulerscheZahl_berechnen (int n){
  21.                
  22.                
  23.          int Approximation2 = 0;
  24.          
  25.        
  26.        
  27.         for (int Approximation1=0; Approximation1 == n; Approximation1++){
  28.                    
  29.                     int Approximation;
  30.                    
  31.                     Approximation = 1/Fakultät_berechnen(Approximation1);
  32.                     Approximation2 = Approximation1 + Approximation2;
  33.                    
  34.                    
  35.         }
  36.                
  37.        
  38.                 return Approximation2;
  39.                
  40.     }
  41.  
  42.    
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement