Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <fstream>
- using namespace std;
- const int MOD = 1e9 + 7;
- int main(){
- int n,num=0;
- cin>>n;
- int k=n,cif=0;
- while (n>0){
- cif=0;
- for (int k=n;k>0;k=k/10){
- cif=max(cif,k%10);
- }
- n=n-cif;
- num++
- ;}
- cout<<num;
- }
- //869167734
- //869167734
Advertisement
Add Comment
Please, Sign In to add comment