Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define spune cout
- #define memoreaza cin
- #define daca if
- #define cattimp while
- #define altfel else
- #define pentru for
- #define returneaza return
- #define intreg int
- #define vid void
- #define folosind using
- #define spatiudenume namespace
- #define procent %
- #define plus +
- #define asta <<
- #define totasta >>
- #define maimicsauegal <=
- #define egal ==
- folosind spatiudenume std;
- intreg ndiv(intreg n, intreg div)
- {
- daca(div maimicsauegal n)
- daca(n procent div egal 0)
- returneaza 1 plus ndiv(n, div plus 1);
- altfel returneaza ndiv(n, div plus 1);
- altfel returneaza 0;
- }
- intreg main(vid)
- {
- intreg n, div=1;
- spune asta "n=";
- memoreaza totasta n;
- spune asta n asta " are " asta ndiv(n, div) asta " divizori.";
- returneaza 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment