Polnochniy

Untitled

Jan 22nd, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. const int N = 3;
  4. int main()
  5. {
  6. int a[N];
  7. int k[N];
  8. setlocale(LC_ALL, "Rus");
  9. cout << "Введите элементы массива " << endl;
  10. for (int i = 0; i < N; i++)
  11. {
  12. cin >> a[i];
  13. }
  14. cout << "Вывод элементов " << endl;
  15. for (int i = 0; i < N; i++)
  16. {
  17. cout << a[i] << " " << endl;
  18. }
  19. cout << " Результат " << endl;
  20. for (int i = 0; i < N; i++)
  21. {
  22. k[i] = 1;
  23. while (a[i] = a[i] / 10)
  24. {
  25. k[i] = k[i] + 1;
  26. }
  27. cout << k[i] << endl;
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment