dice
Sat Oct 07 2023 16:52:35 GMT+0000 (Coordinated Universal Time)
Saved by
@yolobotoffender
#include <iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main() {
int p1n1,p1n2,p2n1,p2n2,sum1,sum2,roll1,roll2;
char name1,name2;
cout<<"player 1 enter your roll number "<<endl;
cin>>roll1;
cout<<"player 1 input your name plz "<<endl;
cin>>name1;
cout<<"player 2 input your name plz "<<endl;
cin>>name2;
cout<<"player 2 enter your roll number "<<endl;
cin>>roll2;
for(int j=1;j<=5;j++){
cout<<"player 1 toss the dice twice:"<<endl;
cin>>p1n1>>p1n2;
sum1 = sum1 + p1n1 + p1n2;
}
cout<<"total score of payer 1 is = "<<sum1<<endl;
for(int j=1;j<=5;j++){
cout<<"player 2 toss the dice twice:"<<endl;
cin>>p2n1>>p2n2;
sum2 = sum2 + p2n1 + p2n2;
}
cout<<"total score of payer 2 is = "<<sum2<<endl;
return 0;
}
content_copyCOPY
Comments