Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include <fstream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5. ifstream f("cnp.in");
  6. ofstream g("cnp.out");
  7. char c[201], *p,separator[]=",./-+;:!@#$%^&*qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
  8. int q,e,w;
  9.  
  10. int main()
  11. {
  12. while(f>>c)
  13. {
  14. p=strtok(c,separator);
  15. while(p)
  16. {
  17. w=strlen(p);
  18. if(w==13)
  19. {
  20. q=0;
  21. for(int i=0;i<13;i++)
  22. {
  23. if(isdigit(p[i])==0)
  24. {
  25. q=1;
  26. break;
  27. }
  28. }
  29. if(q==0)
  30. {
  31. e++;
  32. g<<p<<endl;
  33. }
  34. }
  35. p=strtok(NULL,separator);
  36. }
  37. }
  38. if(e==0)
  39. g<<0;
  40.  
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement