Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pl.edu.uwm.wmii.kirkiewiczjakub.kolokwium01;
- import java.util.Scanner;
- public class Zadanie1 {
- public static void main(String[] args) {
- Scanner in=new Scanner (System.in);
- System.out.println("Podaj liczbe naturalna: ");
- int n = in.nextInt();
- double x=in.nextDouble();
- double mniejsza=x;
- double wieksza=x;
- double rowna=x;
- for(int i=0;i<n-1;i++)
- {
- x=in.nextDouble();
- if(x>5)
- {
- mniejsza++;
- }
- if(x<5)
- {
- wieksza++;
- }
- if(x==5)
- {
- rowna++;
- }
- }
- System.out.println("Wieksze: "+wieksza+"\n mniejsze: "+mniejsza+"\n rowne: "+rowna);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement