Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package quadric_expression;
- import java.util.Scanner;
- public class quad {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- int n ,ed,des,stot,hil,deshil ,sum,max,min,broi=0;
- n = in.nextInt();
- ed= n%10;
- n = n/10;
- des= n%10;
- n = n/10;
- stot= n%10;
- n = n/10;
- hil= n%10;
- n = n/10;
- deshil= n%10;
- n = n/10;
- sum = ed+des+stot+hil+deshil;
- if(sum%2==0){
- max=ed ;
- if (ed>max){
- max=ed;
- }
- if(des>max){
- max=des;
- }
- if(stot>max){
- max=stot;
- }
- if(hil>max){
- max=hil;
- }
- if(deshil>max){
- max=deshil;
- }
- if(ed==max){
- broi++;
- }
- if(des==max){
- broi++;
- }
- if(stot==max){
- broi++;
- }
- if(hil==max){
- broi++;
- }
- if(deshil==max){
- broi++;
- }
- System.out.println("max:"+max);
- System.out.println("broi pyti:"+broi);
- }else{
- min=ed ;
- if (ed<min){
- min=ed;
- }
- if(des<min){
- min=des;
- }
- if(stot<min){
- min=stot;
- }
- if(hil<min){
- min=hil;
- }
- if(deshil<min){
- min=deshil;
- }
- if(ed==min){
- broi++;
- }
- if(des==min){
- broi++;
- }
- if(stot==min){
- broi++;
- }
- if(hil==min){
- broi++;
- }
- if(deshil==min){
- broi++;
- }
- System.out.println("min:"+min);
- System.out.println("broi pyti:"+broi);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement