Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream r("cfdist.in");
- ofstream w("cfdist.out");
- bool v[10];
- int main()
- {
- int n, a=0, b, i=9;
- r>>n;
- while(n!=0){
- b=n%10;
- v[b]=1;
- n=n/10;
- }
- while(i>=0){
- if(v[i]==1){
- a+=1;
- }
- i=i-1;
- }
- w<<a;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement