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