URI Online Judge Problem Solution





Comments

  1. Can u plz write the solutions to this problems also in Java language!

    ReplyDelete
    Replies
    1. Scanner sc= new Scanner(System.in);

      int n,num,i, sum =0, sum1=0, sum2=0, total=0; char chr;
      double per1, per2,per3;
      n=sc.nextInt();
      for(i=0; i<n;i++){

      num=sc.nextInt();
      chr=sc.next().charAt(0);
      if(chr=='C'){
      sum=sum+num;

      }
      else if(chr=='R'){
      sum1=sum1+num;

      }
      else if(chr=='S'){
      sum2=sum2+num;

      }


      } total=sum+sum1+sum2;
      System.out.printf("Total: %d cobaias\n", total);

      System.out.printf("Total de coelhos: %d\n",sum);
      System.out.printf("Total de ratos: %d\n",sum1);
      System.out.printf("Total de sapos: %d\n",sum2);
      per1= (sum*100.00)/total;
      per2= (sum1*100.00)/total;
      per3=(sum2*100.00)/total;
      System.out.printf("Percentual de coelhos: %.2f %% \n", per1);
      System.out.printf("Percentual de ratos: %.2f %% \n", per2);
      System.out.printf("Percentual de sapos: %.2f %% \n", per3);
      System.out.println();

      Delete
  2. there is bug in my URI account. they want a feedback. what i can write in there. please can you give me a solution

    ReplyDelete
  3. i solved mathmatics problem number PROBLEM:
    1028 - Collectable Cards but it show time limit error what is problem please help me

    ReplyDelete
  4. Problem 2146 in java please

    ReplyDelete

Post a Comment

Popular posts from this blog

URI Online Judge | 1036 Bhaskara's Formula (Solution)

URI Online Judge | 1043 Triangle (Solution)

URI Online Judge | 1042 Simple Sort (Solution)