You are not logged in. Please login at www.codechef.com to post your questions!

×

August Challenge - SPELLBOB Whats wrong in my code?

    #include "iostream"
    #include "string.h"
    using namespace std;

    int main() {
            string s1, s2;
            int t;
            cin >> t;
            while(t--) {
                cin >> s1 >> s2;
                    if(s1[0] == 'b' || s2[0] == 'b') {
                            if(s1[1] == 'b' || s2[1] == 'b') {
                                    if(s1[2] == 'o' || s2[2] == 'o')
                                        cout << "yes" << endl;
                                    else
                                        cout << "no" << endl;

                            }

                            else if(s1[1] == 'o' || s2[1] == 'o') {
                                if(s1[2] == 'b' || s2[2] == 'b')
                                    cout << "yes" << endl;
                                else
                                    cout << "no" << endl;


                            }
                            else
                                cout << "no" << endl;


                        }


                    else if(s1[0] == 'o' || s2[0] == 'o') {
                            if(s1[1] == 'b' || s2[1] == 'b') {
                                if(s1[2] == 'b' || s2[2] == 'b')
                                    cout << "yes" << endl;
                                else
                                    cout << "no" << endl;

                            }
                            else
                                cout << "no" << endl;


                        }

                    else
                        cout << "no" << endl;
                }
                return 0;

        } 

asked 06 Aug '18, 19:15

tommotaku's gravatar image

3★tommotaku
-3
accept rate: 0%

100% u are gonna get suspended..

Best of luck....

(06 Aug '18, 19:46) vivek_19982996★

You are not allowed to ask for hints in ongoing competitions not just on codechef on any site be careful next time :)

(06 Aug '18, 20:06) eobardthawne3★

Sorry i'm totally new so i didn't know about this and now i can't edit this either :/

(06 Aug '18, 20:09) tommotaku3★

Have U read the rules and regulations before doing the contest??

link

answered 06 Aug '18, 19:22

khiljee's gravatar image

1★khiljee
393
accept rate: 0%

Please do not post your answer here it's against the rules.

well your program fails for input A=bob B=obb

your Output: no and Expected Output: yes

link

answered 08 Aug '18, 23:00

vishal2611's gravatar image

2★vishal2611
01
accept rate: 0%

well you are also going to be suspended.

(08 Aug '18, 23:50) aryanc4035★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×63
×11
×4
×3

question asked: 06 Aug '18, 19:15

question was seen: 204 times

last updated: 08 Aug '18, 23:02