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;
- int potrebni_ckorcinja[10];
- potrebni_ckorcinja[0] = 6;
- potrebni_ckorcinja[1] = 3;
- potrebni_ckorcinja[2] = 5;
- potrebni_ckorcinja[3] = 5;
- potrebni_ckorcinja[4] = 4;
- potrebni_ckorcinja[5] = 5;
- potrebni_ckorcinja[6] = 5;
- potrebni_ckorcinja[7] = 3;
- potrebni_ckorcinja[8] = 7;
- potrebni_ckorcinja[9] = 5;
- while (N > 0)
- {
- cifra = N % 10;
- N /= 10;
- ckorcinja += potrebni_ckorcinja[cifra];
- }
- cout << ckorcinja << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement