-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCodeForce_122A.cpp
59 lines (53 loc) · 1.36 KB
/
CodeForce_122A.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// 122A
// CONVERT INGEGER INTO STRING ---> to_string
// CONVERT STRING INTO INTEGER ----> stoi()
#include <iostream>
#include <string>
using namespace std;
int main()
{
string word;
// cout << "Enter the value of Lucky Number : ";
if (word.size() <= 1 && word.size() <= 1000)
{
cin >> word;
if (word == "107")
{
cout << "NO" << endl;
}
else if (word[word.size() - 1] == '7' || word[word.size() - 1] == '7')
{
if (word[word.size() - 2] == '4' || word[word.size() - 1] == '4')
{
cout << "YES" << endl;
return 0;
if (word[word.size() - 2] == '4' && word[word.size() - 1] == '4')
{
{
exit(0);
}
}
else if (word[word.size() - 2] == '7' && word[word.size() - 1] == '7')
{
exit(0);
}
}
}
else
{
int num = stoi(word);
// cout << num << endl;
if (num % 4 == 0)
{
if (num == 44)
cout << "YES" << endl;
return 0;
}
else
{
cout << "NO" << endl;
return 0;
}
}
}
}