Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <cstring>
- using namespace std;
- ifstream cin("cnp.in");
- ofstream cout("cnp.out");
- int main()
- {
- char s[256],d[256][256];
- int k=0;
- while(cin>>s)
- {
- char* p=strtok(s," ,;.-!?/\|:}{][()*&^%$#@+~qwertyuiopasdfghjklzxcvbnm");
- while(p)
- {
- int n;
- if(strlen(p)==13)
- {
- n=strlen(p);
- int c=0;
- for(int i=0;i<n;i++)
- if(p[i]>='0'&&p[i]<='9')c++;
- if(c==n)strcpy(d[++k],p);
- }
- p=strtok(NULL," ,;.-!?/\|:}{][()*&^%$#@+~qwertyuiopasdfghjklzxcvbnm");
- }
- }
- if(k==0)cout<<k;
- else for(int i=1;i<=k;i++)
- cout<<d[i]<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement