Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int N;
- int ckorcinja = 0;
- int cifra;
- cin >> N;
- while (N > 0)
- {
- cifra = N % 10;
- N /= 10;
- if (cifra == 0)
- {
- ckorcinja += 5;
- }
- if (cifra == 1)
- {
- ckorcinja += 3;
- }
- if (cifra == 2)
- {
- ckorcinja += 5;
- }
- if (cifra == 3)
- {
- ckorcinja += 5;
- }
- if (cifra == 4)
- {
- ckorcinja += 4;
- }
- if (cifra == 5)
- {
- ckorcinja += 5;
- }
- if (cifra == 6)
- {
- ckorcinja += 5;
- }
- if (cifra == 7)
- {
- ckorcinja += 3;
- }
- if (cifra == 8)
- {
- ckorcinja += 8;
- }
- if (cifra == 9)
- {
- ckorcinja += 5;
- }
- }
- cout << ckorcinja << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement