BUBT Intra-University Programming Contest 2022

BUBT Intra-University Programming Contest

BUBT

Contest problem solution

BUBT Intra-University Programming Contest

A. Total Solve solution in cpp

Question: https://codeforces.com/gym/428051/problem/A

#include<iostream>
using namespace std;
int main()
{
  int a;
  cin>>a;
  if(a%2!=0)
  {
    cout<<"Odd"<<endl;
  }
else{
  cout<<"Even"<<endl;
}
return 0;
}

B. Membership Campaign solution in cpp

Question: https://codeforces.com/gym/428051/problem/B

#include<iostream>
#include<math.h>
#include<conio.h>
using namespace std;
int main()
{
  int t,a,b,c;
  double sum=0;
  double dis=0;double dis2=0;
 
 
  cin>>t;
  for(int i=1;i<=t;i++)
  {
    cin>>a>>b>>c;
 
    sum=a+b+c;
    dis=(sum/100)*150;
    dis2=150-dis;
    
    cout<<"Case "<<i<<": "<<ceil(dis2)<<endl;
 
  }
  return 0;
 
}

Codeforces problem solution

Leave a Comment