Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- void funkcija(int n, int parni, int neparni)
- {
- int mojbroj(n), desetica1(1), desetica2(1);
- while(mojbroj > 0)
- {
- int cifra(mojbroj % 10);
- if(cifra % 2 == 0)
- {
- parni+=cifra*desetica1;
- desetica1*=10;
- }
- else
- {
- neparni+=cifra*desetica2;
- desetica2*=10;
- }
- mojbroj/=10;
- }
- std::cout << parni << std::endl << neparni << std::endl;
- }
- int main()
- {
- funkcija(32564719, 0, 0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement