86132 Zadanie51C

86132 Zadanie51C



File Edit Search Markers Folding View Utilities Macros Plugins Help

O Zadanie51C.java (D:\StraznikTeXasu\UMCS\java\Prog1\)

// REKURENCJA. irnort java.io.*;.

public class Zadanie51C{.

funkcja do pobierania danych.


public static int pobierzLiczbe(String komunikat)^    //

Console konsolka = System.console();.

return Integer.parseInt(konsolka. readLine (komunikat));.

>!


public static int wyrazC(int n){. int wynik;. if (n <= 1) {.

wynik = n + 1;.

} else {.

wynik = 3*wyrazC(n-1) + 2*wyrazC(n-2);.

};•

return wynik; // zwracamy wynik!.

public static void main(String[ ] argumenty) {. int numer;.

numer = pobierzLiczbe("Podaj n: ");.

System, out.println(,rn-ty wyraz wynosi " + wyrazC (numer));.

}•

}•

9.6 Ali


Gava.norie,Cp1250)



12/17


Jlb



Wyszukiwarka

Podobne podstrony:
17686 Zadanie21 File Edit Search Markers Folding View Utilities Macros Plugins Help □łńHS>^ ££$ 0
Zadanie51B File Edit Search Markers Folding View Utilities Macros Plugins Help □łńHS>^ ££$ 0 04-0
17686 Zadanie21 File Edit Search Markers Folding View Utilities Macros Plugins Help □łńHS>^ ££$ 0
80576 Zadanie51B File Edit Search Markers Folding View Utilities Macros Plugins Help □łńHS>^ ££$
Zadanie19 1] jEdit - Zadaniel9.java^ File Edit Search Markers Folding View Utilities Macros Plugins
Zadanie20 File Edit Search Markers Folding View Utilities Macros Plugins Help ££! OO^OO coe pmmm Q
Zadanie22 File Edit Search Markers Folding View Utilities Macros Plugins Help ££! oo^oo pmmm i^u Q
Zadanie51D File Edit Search Markers Folding View Utilities Macros Plugins Help O Zadanie51D.java
Zadanie112 File Edit Search Markers Folding View Utilities Macros Plugins Help oo^oo pmmm i^u Q ©
Program File Edit Search Markers Folding View Utilities Macros Plugins HelpOłfe<S>/> ££! O
Program File Edit Search Markers Folding View Utilities Macros Plugins Help fiS 0 04-0 0 : - tf

więcej podobnych podstron