-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path370_Llave_1314.cpp
56 lines (42 loc) · 924 Bytes
/
370_Llave_1314.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
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <cmath>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
#define NO false
#define SI true
#define FOR(a,b) for(int i=(a);i<(b);i++)
#define ORDENAR(a) qsort((a),ARRAY_SIZE((a)),sizeof((a[0])),compare)
class nameClass
{
public:
nameClass(); // Constructor
};
int n_inputs;
int main()
{
cin>>n_inputs;
for(int i=0; i<n_inputs; i++)
{
string llave;
// Entrada
cin>> llave;
string llave2= llave;
int n= llave.find("-");
llave.erase(llave.begin(), llave.begin()+n+1);
int sz= llave2.size();
sz=llave2.find("-");
llave2.resize(sz);
long long int n2= stoi(llave);//atoi(llave.c_str());
long long int n1= stoi(llave2);
if(!(n1%2) && ((n2-n1)==1) || !(n2%2) && (n1-n2)==1)
cout<<"SI"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}