Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5. ifstream r("cfdist.in");
  6. ofstream w("cfdist.out");
  7.  
  8. bool v[10];
  9.  
  10. int main()
  11. {
  12.     int n,  a=0, b, i=9;
  13.     r>>n;
  14.     while(n!=0){
  15.         b=n%10;
  16.         v[b]=1;
  17.         n=n/10;
  18.     }
  19.     while(i>=0){
  20.         if(v[i]==1){
  21.             a+=1;
  22.         }
  23.         i=i-1;
  24.     }
  25.     w<<a;
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement