Advertisement
2001paskalpaskalev

tursene v masiv

Apr 10th, 2024
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int a[] = {10, 7, 8, 3, 43, 23, 97, 109, 92, 85, -10000};
  5.  
  6.  
  7. int tupo_dursene(int tursq_tova)
  8. {
  9.  
  10. for (int i = 0; i < 10; i++) {
  11. cout << "proverki " << i << endl;
  12. if(a[i] == tursq_tova) {
  13. cout << "namerih " << tursq_tova << endl;
  14. }
  15. }
  16. return 0;
  17. }
  18.  
  19. int po_malko_tupo_tursene(int tursq_tova) {
  20.  
  21. int i = 0;
  22. while (tursq_tova != a[i]){
  23. cout << "umni proverki " << i << endl;
  24. i++;
  25. }
  26.  
  27. return 0;
  28. }
  29.  
  30. void kotwa(int tursq_tova) {
  31. a[10] = tursq_tova;
  32. int i=0;
  33. while (tursq_tova != a[i]){
  34. cout << "kotweni proverki " << i << endl;
  35. i++;
  36. }
  37. if (i == 10) {
  38. cout << "ne e nameren" << endl;
  39. }else {
  40. cout << "nameren e na" << i << endl;
  41. }
  42. }
  43.  
  44. void mnogo_gaden(int tursq_tova) {
  45. //dihotomiq
  46.  
  47. a = qsort(a, 11);
  48. cout << a << endl;
  49. }
  50.  
  51. int main() {
  52. int x;
  53. cin >> x;
  54. tupo_dursene(x);
  55. kotwa(x);
  56. po_malko_tupo_tursene(x);
  57.  
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement