Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main()
- {
- int k;
- int m;
- int n;
- int brojac=0;
- int cifri=0;
- cin>>k;
- cin>>m;
- cin>>n;
- int y=0;
- vector<int>v;
- for(int u = k; u <= m; u+=1){
- v.push_back(u);
- }
- for(int u1=0; u1<v.size(); u1+=1){
- if(v[u1]/1000!=0){
- cifri+=4;
- }
- else if(v[u1]/100!=0){
- cifri+=3;
- }
- else if(v[u1]/10!=0){
- cifri+=2;
- }
- else if(v[u1]/1!=0){
- cifri+=1;
- }
- }
- int rezultat = cifri;
- y = n;
- while(y<=cifri){
- rezultat--;
- y += n;
- }
- cout<<rezultat;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement