Codechef Practice | Week 4

1. The Cheaper Cab: CABS

``````// THIS code starts from INT MAIN so copy paste from here only

#include<iostream>
using namespace std;

int main()
{
int t;
cin>>t;
for(int i=0; i < t; i++){
int x , y;
cin>>x>>y;
if(y>x){
cout << "FIRST" << endl;
}
else if(y==x){
cout <<"ANY" << endl;
}
else{
cout <<"SECOND" << endl;
}
}
return 0;
}``````

2. Volume Control: VOLCONTROL

``````#include <iostream>
using namespace std;

int main() {
int t;
cin>>t;
for(int i=0; i < t; i++){
int x, y;
cin>>x>>y;
if((x>y) || (x==y)){
cout << (x-y) << endl;
}
else{
cout << (y-x) << endl;
}

}
return 0;
}``````

3. Is it a VOWEL or CONSONANT: VOWELTB

``````#include <iostream>
using namespace std;

int main() {
char c;
cin>>c;
if(c=='A' || c=='E' || c=='I' || c=='O' || c=='U'){
cout << "Vowel" << endl;
}
else{
cout << "Consonant" << endl;
}
return 0;
}``````

4. Which Mixture: MIXTURE

``````#include <iostream>
using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
int a,b;
cin>>a>>b;
if(a>0 && b>0)
cout <<"Solution\n";
else if(a==0)
cout <<"Liquid\n";
else
cout <<"Solid\n";
}
return 0;
}``````

5. Chef and Chefina: CFCFNA

``````#include<iostream>
using namespace std;

int main()
{
int t;
cin>>t;
while(t--)
{
int a,b,c;
cin>>a>>b;
c=a+b;
if(c < 3) {
cout << 1 << endl;
}
else if (c>=3 && c <= 10) {
cout << 2 << endl;
}

else if (c>=11 && c <= 60) {
cout << 3 << endl;
}

else if (c>60)
cout << 4 << endl;

}
return 0;
}``````

KUIZZER Helping Educational website for Youngers

Welcome To Kuizzer!

KUIZZER - Helping Educational Website for YoungersYour Post is going to visible like this

Here, Your Promotional Details are going to visible for others whenever they visit the site !

Looks like you are using an ad-blocking browser extension. We request you to whitelist our website on the ad-blocking extension and refresh your browser to view the content.

Check out our merchandise, available at kuizzer.in

X
0