Advertisement
Merry123

Untitled

Apr 3rd, 2022
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SmallestOfTreeNumbers {
  4. public static void main(String[] args) {
  5.  
  6. Scanner sc = new Scanner(System.in);
  7. int a = sc.nextInt();
  8. int b = sc.nextInt();
  9. int c = sc.nextInt();
  10. PrintTheSmallestInteger(a, b, c);
  11. }
  12. public static void PrintTheSmallestInteger(int a, int b, int c) {
  13. if (a < b && a < c) {
  14. System.out.println(a);
  15. }
  16. if (b < a && b < c) {
  17. System.out.println(b);
  18. }
  19. if (c < a && c < b) {
  20. System.out.println(c);
  21. }
  22. }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement