Please Install our Kuizzer app ! ---- Doesn't Know how to install click here!

Codechef Practice | Week 4

CODECHEF SOLUTION

Week 4 link: Chandigarh University – Practice – Week 4 Coding Competition | CodeChef

1. The Cheaper Cab: CABS

link: The Cheaper Cab – Submit

// 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

link: Volume Control – Submit

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	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


link: VOWELTB – Submit

#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

link: Which Mixture – Submit

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	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

link: Chef and Chefina- Submit

#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;
}

* The material and content uploaded on this website are for general information and reference purposes only and don’t copy the answers of this website to any other domain without any permission or else copyright abuse will be in action.

Please do it by your own first!

DMCA.com Protection Status

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
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 !

AdBlock Detected

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
Would love your thoughts, please comment.x
()
x