Reply yes/no. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 12

Reply yes/no.

Has your 20 line code given 21 or more errors? Reply yes/no :language you were using.

26th Feb 2017, 2:52 AM
Ram chandra Giri
Ram chandra Giri - avatar
6 Answers
+ 13
My zero line code can return 1 line error so yeah :P
26th Feb 2017, 3:18 AM
Hatsy Rei
Hatsy Rei - avatar
+ 17
@Christopher Madi Was it really necessary to copy my entire Magic 8-Ball code and post it here? 😐
31st Mar 2017, 5:50 AM
Hatsy Rei
Hatsy Rei - avatar
+ 10
yes: c
26th Feb 2017, 2:52 AM
Ram chandra Giri
Ram chandra Giri - avatar
+ 9
Yes, C++
4th Mar 2017, 7:17 AM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar
+ 3
it gives me an error at the time. I don't keep track of them every time.
26th Feb 2017, 7:25 AM
seamiki
seamiki - avatar
0
#include <iostream> #include <cstdlib> #include <ctime> #include <string> using namespace std; /* WHY?! WHY DID I NEVER THOUGHT OF DOING THIS?! *** Magic 8-Ball is a toy used for fortune-telling or seeking advice, developed in the 1950s and manufactured by Mattel. - Wikipedia *** Input your question and see what the Magic 8-Ball tells you! */ int main(int argc, char *argv[]) { srand(time(0)); string question; getline(cin,question); cout << "Your question: " << question << endl << endl; cout << "Magic 8-Ball : "; switch(rand() % 20) { case 0: cout << "It is certain."; break; case 1: cout << "It is decidedly so."; break; case 2: cout << "Without a doubt."; break; case 3: cout << "Yes definitely."; break; case 4: cout << "You may rely on it."; break; case 5: cout << "As I see it, yes."; break; case 6: cout << "Most likely."; break; case 7: cout << "Outlook good."; break; case 8: cout << "Yes."; break; case 9: cout << "Signs point to yes."; break; case 10: cout << "Reply hazy try again."; break; case 11: cout << "Ask again later."; break; case 12: cout << "Better not tell you now."; break; case 13: cout << "Cannot predict now."; break; case 14: cout << "Concentrate and ask again."; break; case 15: cout << "Don't count on it."; break; case 16: cout << "My reply is no."; break; case 17: cout << "My sources say no."; break; case 18: cout << "Outlook not so good."; break; case 19: cout << "Very doubtful."; break; } return 0; }
30th Mar 2017, 3:00 PM
Christopher Madi
Christopher Madi - avatar