Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Random
SUBMITTED BY:
Guest
DATE:
Dec. 23, 2013, 12:24 a.m.
FORMAT:
C++
SIZE:
711 Bytes
Raw
Download
Tweet
HITS:
6780
Go to comments
Report
#include
<iostream>
#include
<cstdlib>
#include
<ctime>
using
namespace
std
;
int
main
()
{
int
i
,
j
;
int
ctr
(
0
);
srand
(
time
(
0
));
i
=
rand
()
%
6
+
1
;
do
{
cout
<<
"Masukkan tebakan angka: "
;
cin
>>
j
;
if
(
j
>
i
)
cout
<<
"Angka terlalu BESAR
\n
"
;
else
if
(
j
==
i
)
{
cout
<<
"JAWABAN BENAR!
\n
"
;
break
;
}
else
cout
<<
"Angka terlalu KECIL
\n
"
;
ctr
++
;
}
while
(
ctr
<
3
);
if
(
ctr
==
3
)
cout
<<
"kok bodo sih!!?"
;
return
0
;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus