Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. #include<ctime>
  4. #include <cstdlib>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. setlocale(LC_ALL, "Swedish");
  11. srand((unsigned)time(0));
  12. int nrOFRolls=0;
  13. int result=0;
  14. int summa=0; //sum
  15. int ingen=0;
  16. char player;
  17.  
  18. cout<<"Nu spelar vi"" ""Tur i tärning!"<<endl; //lets play a game
  19. cout<<"Hur många tärningskast ska göras per spelare?"; // how many rolls should each player have?
  20. cin>>nrOFRolls;
  21.  
  22.  
  23. for(int i=0; i<=nrOFRolls; i++)
  24.  
  25. {
  26. @h@cout<<"Namnet på spelaren?"; //name of the player
  27. cin>>player;
  28. result=(rand()%6+1);@h@ //here is the part where i got stuck bcs when i runt this it just me couple of rolls and enter name of the player and then it closes...
  29.  
  30. }
  31.  
  32.  
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement