Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cstring>
- using namespace std;
- ifstream fin("cnp.in");
- ofstream fout("cnp.out");
- char cuvant[2000];
- char CNP[2000],aux[1];
- bool ok;
- int main()
- {
- while(!fin.eof())
- {
- fin.get(cuvant,200);
- fin.get();
- int i = 0;
- while(i < strlen(cuvant))
- {
- while(isdigit(cuvant[i]))
- {
- aux[0]=cuvant[i];
- strcat(CNP, aux);
- i++;
- }
- if(strlen(CNP)==13)
- fout << CNP << endl,
- ok = true;
- strcpy(CNP,"");
- i++;
- }
- }
- if(!ok)
- fout << 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement