Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int zbir_cifri(int i) {
- if(i == 0) {
- return 0;
- }
- return zbir_cifri(i / 10) + (i % 10);
- }
- int main() {
- int N;
- scanf("%d", &N);
- printf("%d\n", zbir_cifri(N));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement