#include long long call_count = 0; long long przestaw(long long n) { call_count++; long long r = n % 100; long long a = n / 10; long long b = r % 10; n = n / 100; if (n > 0) { return a + 10 * b + 100 * przestaw(n); } else { if (a > 0) { return a + 10 * b; } else { return b; } } } int main() { long long test_values[] = {316498, 43657688, 154005710, 998877665544321}; int num_tests = sizeof(test_values) / sizeof(test_values[0]); printf("+------------------+-----------------------------------+-------------------------------+\n"); printf("| n | Wynik działania funkcji przestaw | Liczba wywołań funkcji przestaw |\n"); printf("+------------------+-----------------------------------+-------------------------------+\n"); for (int i = 0; i < num_tests; i++) { call_count = 0; long long result = przestaw(test_values[i]); printf("| %-16lld | %-33lld | %-30lld |\n", test_values[i], result, call_count); } printf("+------------------+-----------------------------------+-------------------------------+\n"); return 0; }