Advertisement
Guest User

Untitled

a guest
Dec 15th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <fstream>
  2. #include <cstring>
  3. using namespace std;
  4. ifstream cin("cnp.in");
  5. ofstream cout("cnp.out");
  6. int main()
  7. {
  8. char s[256],d[256][256];
  9. int k=0;
  10.  
  11. while(cin>>s)
  12. {
  13. char* p=strtok(s," ,;.-!?/\|:}{][()*&^%$#@+~qwertyuiopasdfghjklzxcvbnm");
  14. while(p)
  15. {
  16. int n;
  17. if(strlen(p)==13)
  18. {
  19. n=strlen(p);
  20. int c=0;
  21. for(int i=0;i<n;i++)
  22. if(p[i]>='0'&&p[i]<='9')c++;
  23. if(c==n)strcpy(d[++k],p);
  24. }
  25.  
  26. p=strtok(NULL," ,;.-!?/\|:}{][()*&^%$#@+~qwertyuiopasdfghjklzxcvbnm");
  27.  
  28. }
  29. }
  30.  
  31. if(k==0)cout<<k;
  32. else for(int i=1;i<=k;i++)
  33. cout<<d[i]<<endl;
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement