Skip to content

Instantly share code, notes, and snippets.

@paintedpotato
Created February 12, 2021 10:07
Show Gist options
  • Save paintedpotato/8f08c3f783e06d6772e6c5950d11244e to your computer and use it in GitHub Desktop.
Save paintedpotato/8f08c3f783e06d6772e6c5950d11244e to your computer and use it in GitHub Desktop.
Random Responses - based on question
#include<iostream>
#include<cstdlib>
#include<string>
using namespace std;
string rRandom(int x){
string name;
switch(x){
case 0:
name = "don't";
return name;
break;
case 1:
name = "do";
return name;
break;
case 2:
name = "bye";
return name;
break;
}
}
main(){
int i;
string name;
int x = rand() % 2;
string qn1 = "hey, how are you?";
cout<<qn1<<endl;
name = rRandom(x);
cout<<name<<endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment