Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- // ZADANIE 16
- int suma_wartosci_cyfr(int liczba)
- {
- if(liczba == 0)
- return 0;
- return liczba % 10 + suma_wartosci_cyfr(liczba / 10);
- }
- int main()
- {
- cout << suma_wartosci_cyfr(269745) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement