Skip to content

Commit 58974c2

Browse files
committed
new one
1 parent cc15669 commit 58974c2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

playing_with_dice.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
ios::sync_with_stdio(false);
7+
cin.tie(0);
8+
int a,b;
9+
int first=0,draw=0,second=0;
10+
cin>>a>>b;
11+
for(int i=1;i<=6;i++) {
12+
if(abs(a-i)<abs(b-i)) first+=1;
13+
else if(abs(a-i)>abs(b-i)) second+=1;
14+
else draw+=1;
15+
}
16+
cout<<first<<" "<<draw<<" "<<second<<endl;
17+
return 0;
18+
}

0 commit comments

Comments
 (0)