Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
#include <iostream>#include <ctime>using namespace std;int main (){ int random1=0, random2=0, count=5;cout<<"Your cards are "; do { srand(time(0)); random1 = rand()%14+1; count++; cout<<""<<random1<<""; switch(random1) { class 2; cout<<"2"; break; class 3; cout<<"3"; break; class 4; cout<<"4"; break; class 5; cout<<"5"; break; class 6; cout<<"6"; break; class 7; cout<<"7"; break; class 8; cout<<"8"; break; class 9; cout<<"9"<<endl; break; class 10; cout<<"10"; break; class 11; cout<<"J"; break; class 12; cout<<"Q"; break; class 13; cout<<"K"; break; class 14; cout<<"A"; break; } }while (count < 0);return 0;}
#include <iostream>#include <ctime>using namespace std;int main(){ int random1=0, random2=0, count=5; cout<<"Your cards are " << endl; do { srand(time(0)); random1 = rand()%14+1; count++; cout << "" << random1; switch(random1) { case 2: cout<<"2"; break; case 3: cout<<"3"; break; case 4: cout<<"4"; break; case 5: cout<<"5"; break; case 6: cout<<"6"; break; case 7: cout<<"7"; break; case 8: cout<<"8"; break; case 9: cout<<"9"<<endl; break; case 10: cout<<"10"; break; case 11: cout<<"J"; break; case 12: cout<<"Q"; break; case 13: cout<<"K"; break; case 14: cout<<"A"; break; } }while (count < 0);return 0;}
#include <iostream>#include <ctime>using namespace std;int main (){ int random1=0, random2=0, count=0; cout<<"Your cards are "; for (;count<5;count++) { srand(time(0)); random1 = rand()%14+1; switch(random1) { case 2: cout<<"2 "; break; case 3: cout<<"3 "; break; case 4: cout<<"4 "; break; case 5: cout<<"5 "; break; case 6: cout<<"6 "; break; case 7: cout<<"7 "; break; case 8: cout<<"8 "; break; case 9: cout<<"9 "<<endl; break; case 10: cout<<"10 "; break; case 11: cout<<"J "; break; case 12: cout<<"Q "; break; case 13: cout<<"K "; break; case 14: cout<<"A "; break; } }return 0;}
#include <iostream>#include <ctime>using namespace std;int main (){ int random1=0, random2=0, count=0; cout<<"Your cards are "; srand(time(0)); for (;count<5;count++) { random1 = rand()%13+2; switch(random1) { case 2: cout<<"2 "; break; case 3: cout<<"3 "; break; case 4: cout<<"4 "; break; case 5: cout<<"5 "; break; case 6: cout<<"6 "; break; case 7: cout<<"7 "; break; case 8: cout<<"8 "; break; case 9: cout<<"9 "; break; case 10: cout<<"10 "; break; case 11: cout<<"J "; break; case 12: cout<<"Q "; break; case 13: cout<<"K "; break; case 14: cout<<"A "; break; } } return 0;}