Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int a[] = {10, 7, 8, 3, 43, 23, 97, 109, 92, 85, -10000};
- int tupo_dursene(int tursq_tova)
- {
- for (int i = 0; i < 10; i++) {
- cout << "proverki " << i << endl;
- if(a[i] == tursq_tova) {
- cout << "namerih " << tursq_tova << endl;
- }
- }
- return 0;
- }
- int po_malko_tupo_tursene(int tursq_tova) {
- int i = 0;
- while (tursq_tova != a[i]){
- cout << "umni proverki " << i << endl;
- i++;
- }
- return 0;
- }
- void kotwa(int tursq_tova) {
- a[10] = tursq_tova;
- int i=0;
- while (tursq_tova != a[i]){
- cout << "kotweni proverki " << i << endl;
- i++;
- }
- if (i == 10) {
- cout << "ne e nameren" << endl;
- }else {
- cout << "nameren e na" << i << endl;
- }
- }
- void mnogo_gaden(int tursq_tova) {
- //dihotomiq
- a = qsort(a, 11);
- cout << a << endl;
- }
- int main() {
- int x;
- cin >> x;
- tupo_dursene(x);
- kotwa(x);
- po_malko_tupo_tursene(x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement