Advertisement
L3peha

ODDEVEN

Dec 8th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. char a;
  8. int b;
  9. cin.get( a);
  10. b = a - 48;
  11. while (a != '\n')
  12. {
  13. cin.get(a);
  14. if (a == '\n')
  15. {
  16. if (b % 2 == 0)
  17. {
  18. cout << "even";
  19. return 0;
  20. }
  21. else
  22. {
  23. cout << "odd";
  24. return 0;
  25. }
  26. }
  27. b = a - 48;
  28.  
  29.  
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement