From 48069b8ae059abad95ac8e894f3bf27ef17f6f7f Mon Sep 17 00:00:00 2001 From: shirohige11037 Date: Tue, 19 Aug 2025 10:51:14 +0900 Subject: [PATCH 1/2] =?UTF-8?q?add=20:=20=E3=83=80=E3=82=A4=E3=82=B9?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=81=AE=E3=83=A1=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E9=96=A2=E6=95=B0=E3=82=92=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shige_2nd.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 shige_2nd.cpp diff --git a/shige_2nd.cpp b/shige_2nd.cpp new file mode 100644 index 0000000..2a70fd0 --- /dev/null +++ b/shige_2nd.cpp @@ -0,0 +1,28 @@ +#include +#include +#include + +bool dice(int num1,int num2); + +int main(void){ + srand((unsigned int)time(NULL)); + + printf("1dn m?\n>>"); + int num1,num2; + + scanf_s("%d %d",&num1,&num2); + + if(dice(num1,num2)){ + printf("成功です\n"); + return 0; + } + + printf("失敗です\n"); + + return 0; +} + +bool dice(int num1,int num2){ + bool ans = true; + return ans; +} \ No newline at end of file From 3bde3f950d89f0fafd6bcb86a719d49ce51494fe Mon Sep 17 00:00:00 2001 From: shirohige11037 Date: Tue, 19 Aug 2025 10:57:09 +0900 Subject: [PATCH 2/2] =?UTF-8?q?update=20:=20=E3=83=80=E3=82=A4=E3=82=B9?= =?UTF-8?q?=E3=81=AE=E5=87=A6=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shige_2nd.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shige_2nd.cpp b/shige_2nd.cpp index 2a70fd0..6ec7a92 100644 --- a/shige_2nd.cpp +++ b/shige_2nd.cpp @@ -24,5 +24,9 @@ int main(void){ bool dice(int num1,int num2){ bool ans = true; + int num = rand() % num1; + printf("%d\n",num); + + ans = num > num2; return ans; } \ No newline at end of file