-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathXV.cpp
More file actions
33 lines (31 loc) · 642 Bytes
/
XV.cpp
File metadata and controls
33 lines (31 loc) · 642 Bytes
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
#include <iostream>
#include <string>
using namespace std;
int main()
{
string num;
while (cin >> num)
{
if (num == "0")
break;
int sum = 0;
if (num[num.length() - 1] == '0' || num[num.length() - 1] == '5')
{
for (int i = 0; i < num.length(); i++)
{
sum += (int)num[i];
}
if (sum % 3 == 0)
{
cout << "TAK" << endl;
}
else
{
cout << "NIE" << endl;
}
}
else
cout << "NIE" << endl;
}
return 0;
}