Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3. using namespace std;
  4. bool isIt(char* a)
  5. {
  6. bool succes = false;
  7. int i = 0;
  8. for (i = 0; i < strlen(a); i++)
  9. {
  10. for (int k = 0; k < 10; k++)
  11. {
  12. if (a[i] == 48 + k)
  13. succes = true;
  14. }
  15. if (succes == false) return false;
  16. succes = false;
  17. }
  18. int you_are_div4 = (a[i - 2] - 48) * 10 + a[i - 1] - 48;
  19. if (you_are_div4 % 4) return false;
  20. return true;
  21. }
  22. int main()
  23. {
  24. char a[100] = "";
  25. char tmp[50];
  26. cin.getline(a, 99);
  27. int j = 0, b, kolvo = 0;
  28. for (int q = 0; a[q] != '\n'; q++)
  29. {
  30. b = a[q];
  31. if (b == ' ')
  32. kolvo++;
  33. }
  34. for (int z = 0; z < kolvo; z++)
  35. {
  36. for (j; a[j] != ' '; j++)
  37. {
  38. tmp[j] = a[j];
  39. if (a[j] == ' ')
  40. break;
  41. }
  42. for (int i = 0; i < '\n'; i++)
  43. {
  44. if (*(tmp + i) < 48 || *(tmp + i) > 57)
  45. {
  46. break;
  47. }
  48. if (isIt(tmp))
  49. {
  50. cout << tmp << '\t';
  51. cout << "Yeah boyyyy!\n";
  52. }
  53. else
  54. {
  55. cout << tmp << '\t';
  56. cout << "NOOOOO!";
  57. }
  58. }
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement