Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
using namespace std; int main() { cout << "Zamisli eden broj od 1 do 1000, i ne mi go kazuvaj" << endl; cout << "So maksimum 11 prasanja ke go pogodam brojot" << endl; int L = 1, R = 1000; while(L <= R) { int middle = (L + R) / 2; cout << "Vnesi 0 ako " << middle << " e tvojot zamislen broj, vnesi -1 ako e pomal od " << middle << ", ili vnesi 1 ako e pogolem od " << middle << endl; int x; cin >> x; if(x == 0) { cout << "Tvojot broj e " << middle << ". Kraj na igrata!" << endl; break; } else if(x == -1) { R = middle - 1; } else { L = middle + 1; } } return 0; } // 972
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)