Advertisement
DorSen

Bilet 17

Jan 16th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.23 KB | None | 0 0
  1. Билет 17
  2. #include<iostream>
  3. //#include<string>
  4. //using namespace std;
  5. //
  6. //int main() {
  7. //    setlocale(0, "");
  8. //    string s;
  9. //    int a[100], p, j;
  10. //    p = 0;
  11. //    cout << "Введите число: ";
  12. //    cin >> s;
  13. //    int d = 0;
  14. //    for (int i = 0; i < s.length(); i++) {
  15. //        a[d] = s[i];
  16. //        d++;
  17. //    }
  18. //    for (int i = 0; i < s.length(); i++) {
  19. //        for (int j = 0; j < s.length(); j++) {
  20. //            if (a[j] > a[j + 1]) {
  21. //                int b = a[j];
  22. //                a[j] = a[j + 1];
  23. //                a[j + 1] = b;
  24. //            }
  25. //        }
  26. //    }
  27. //    for (int i = 0; i < s.length(); i++) {
  28. //        if (a[i] == a[i + 1]) {
  29. //            a[i] = 0;
  30. //        }
  31. //    }
  32. //    for (int i = 0; i < s.length(); i++) {
  33. //        if (a[i] != 0) {
  34. //            p++;
  35. //        }
  36. //    }
  37. //    cout << "Вот из скольких цифр состоит число: ";
  38. //    cout << p << endl;
  39. //    return 0;
  40. //}
  41. //#include <iostream>
  42. //using namespace std;
  43. //int main() {
  44. //  int x;
  45. //  int k;
  46. //  cin >> k >> x;
  47. //  int n = k * k;
  48. //  for (; n; n /= 10)
  49. //      if (n % 10 == x)
  50. //      {
  51. //          cout << "YES";
  52. //          return 0;
  53. //      }
  54. //  cout << "NO";
  55. //  return 0;
  56. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement