Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- using namespace std;
- bool isIt(char* a)
- {
- bool succes = false;
- int i = 0;
- for (i = 0; i < strlen(a); i++)
- {
- for (int k = 0; k < 10; k++)
- {
- if (a[i] == 48 + k)
- succes = true;
- }
- if (succes == false) return false;
- succes = false;
- }
- int you_are_div4 = (a[i - 2] - 48) * 10 + a[i - 1] - 48;
- if (you_are_div4 % 4) return false;
- return true;
- }
- int main()
- {
- char a[100] = "";
- char tmp[50];
- cin.getline(a, 99);
- int j = 0, b, kolvo = 0;
- for (int q = 0; a[q] != '\n'; q++)
- {
- b = a[q];
- if (b == ' ')
- kolvo++;
- }
- for (int z = 0; z < kolvo; z++)
- {
- for (j; a[j] != ' '; j++)
- {
- tmp[j] = a[j];
- if (a[j] == ' ')
- break;
- }
- for (int i = 0; i < '\n'; i++)
- {
- if (*(tmp + i) < 48 || *(tmp + i) > 57)
- {
- break;
- }
- if (isIt(tmp))
- {
- cout << tmp << '\t';
- cout << "Yeah boyyyy!\n";
- }
- else
- {
- cout << tmp << '\t';
- cout << "NOOOOO!";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement