Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.sun.org.apache.xpath.internal.SourceTree;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Scanner;
- public class FirstSample {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- System.out.println("Podaj liczbę dla której chcesz znać wartość silnia: ");
- int a = in.nextInt();
- int b = 1;
- int d;
- for (int c = 0; c<a; c= c+1) {
- b = b * a;
- a= a-1;
- System.out.println(b);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement