gnopaste
Sorry for this ugly message. We are searching for some translators.
Please take a look here
Thanks to all translators, you're doing a great job!
Userdata
Name
[java]Fattoriale
Scriptlanguage
Java
Tabwidth
4
Date
03/13/2010 01:37:48 pm
IP
151.32.237.64
Description
[http://capiamoinsieme.bloog.it] Calcolo del fattoriale in modo ricorsivo
Code (
Hide rownumbers
)
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package
javaapplication1;
import
java.util.*;
/**
*
* @author Administrator
*/
public
class
Fattoriale {
public
static
long
fattoriale(
int
n){
if
(n<=0)
return
1;
else
return
n*fattoriale(n-1);
}
public
static
void
main(String[] args) {
Scanner in=
new
Scanner(System.in);
System.out.println("Digita un intero: ");
int
n=in.nextInt();
System.out.println("Il fattoriale di "+n+"รจ: "+ fattoriale(n));
}
}
submitter »
gnopaster
|
imprint
« imprint
»
Terms of use
«