Advertisement
Guest User

iadaci

a guest
Mar 31st, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. short ok=0;
  9. char s[201];
  10. cin.get(s,200);
  11. cin.get();
  12. for(int i=0;i<strlen(s);i++)
  13. {
  14. if(s[i+1])
  15. {
  16. if(s[i]==43 || s[i]==45 || s[i]==42 || s[i]==47 &&
  17. s[i+1]==43 || s[i+1]==45 || s[i+1]==42 || s[i+1]==47)
  18. ok=1;
  19. cout<<ok<<endl;
  20. if(s[i]==40 && s[i+1]==43 || s[i+1]==45 || s[i+1]==42 || s[i+1]==47)
  21. ok=1;
  22. cout<<ok<<endl;
  23. if(!(s[i]>=48 && s[i]<=57) || !(s[i]>=97 && s[i]<=122))
  24. ok=1;
  25. cout<<ok<<endl;
  26. }
  27.  
  28. }
  29. if(ok==0)
  30. cout<<1;
  31. else
  32. cout<<0;
  33. //e=[(a+b)/2]*4+(b*c+5)
  34.  
  35.  
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement