Advertisement
askarulytarlan

rock,paper,scissors c++

Mar 27th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cmath>
  4. #include <vector>
  5. #include <algorithm>
  6. #include <cstdio>
  7. #include <math.h>
  8. #include <string>
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include <string>
  12. #include <stdlib.h>
  13. #include <cmath>
  14. #include <iomanip>
  15. #include <queue>
  16. #include <utility>
  17. #include <vector>
  18. #include <stack>
  19. #include <list>
  20. #include <iterator>
  21. #include <cctype>
  22. #include <exception>
  23. #include <cstdlib>
  24. #include <stdexcept>
  25. #include <csignal>
  26. #include <pthread.h>
  27.  
  28. using namespace std;
  29.  
  30. int main(int argc, const char * argv[]) {
  31.  
  32. string a,b;
  33. cin>>a>>b;
  34. if (a.compare("scissors") == 0 ) {
  35. if (b.compare("rock") == 0 ) {
  36. cout<<"second"<<endl;
  37. }
  38. else if (b.compare("paper") == 0 ) {
  39. cout<<"first"<< endl;
  40. }
  41. else{
  42. cout<<"draw"<<endl;
  43. }
  44. }
  45. if (a.compare("rock") == 0 ) {
  46. if (b.compare("paper") == 0 ) {
  47. cout<<"second"<<endl;
  48. }
  49. else if (b.compare("scissors") == 0 ) {
  50. cout<<"first"<< endl;
  51. }
  52. else{
  53. cout<<"draw"<<endl;
  54. }
  55. }
  56. if (a.compare("paper") == 0 ) {
  57. if (b.compare("scissors") == 0 ) {
  58. cout<<"second"<<endl;
  59. }
  60. else if (b.compare("rock") == 0 ) {
  61. cout<<"first"<< endl;
  62. }
  63. else{
  64. cout<<"draw"<<endl;
  65. }
  66. }
  67. return 0;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement