Uri 1094 Solution || Beecrowd 1094 – Experiments solution in C

Uri 1094 solution || Beecrowd 1094 – Experiments solution in C

Uri 1094 Question And Submission link

Experiments

Beecrowd 1094/Uri 1094 Solution in C

#include <stdio.h>

int main() {
char cat;
int n,i,cob,coe=0,rat=0,sap=0,sum=0;
scanf("%d",&n);
for(i=0;i<n;i++){
    scanf("%d %c",&cob,&cat);
    if('C'==cat){
         coe=coe+cob;
    }
    else if('R'==cat){//Beecrowd 1094
         rat=cob+rat;
    }
    else if('S'==cat){
         sap=sap+cob;
    }

}


double pcoe=1,prats=1,psap=1;
sum=coe+rat+sap;
pcoe=(coe/(sum*1.0))*100.00;
prats=(rat/(sum*1.0))*100.00;
psap=(sap/(sum*1.0))*100.00;
printf("Total: %d cobaias\n",sum);
printf("Total de coelhos: %d\n",coe);
printf("Total de ratos: %d\n",rat);
printf("Total de sapos: %d\n",sap);
printf("Percentual de coelhos: %.2lf %%\n",pcoe);
printf("Percentual de ratos: %.2lf %%\n",prats);
printf("Percentual de sapos: %.2lf %%\n",psap);//Beecrowd 1094
    return 0;
}

Beecrowd 1159 – Sum of Consecutive Even Numbers solution in C/CPP

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
NEW TOXIC ROCKET CYCLE DECK in Clash Royale 2023 Best Deck in Clash Royale Best Deck for Arena 8 in Clash Royale Best Hog deck for Pro players Best Clash Royale Deck