-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1240.cpp
More file actions
41 lines (35 loc) · 686 Bytes
/
Copy path1240.cpp
File metadata and controls
41 lines (35 loc) · 686 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
34
35
36
37
38
39
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <list>
#include <vector>
#define fr(i, a, c) for (int i = a; i < c; i++)
#define sc1(a) scanf("%d", &a)
#define sc2(a, b) scanf("%d %d", &a, &b)
typedef long long int lli;
typedef unsigned long long ull;
using namespace std;
int main(int argc, char const *argv[])
{
lli a,b, aux,aux2,div;
int n, flag;
scanf("%d", &n);
fr(i,0,n) {
flag = 0;
scanf("%Ld %Ld", &a, &b);
aux = 0;
aux2 = a;
div = 10;
while (aux <= a){
aux = aux2%div;
if (b == aux) {
flag = 1;
break;
}
if (a == aux) break;
div *= 10;
}
if (flag) printf("encaixa\n");
else printf("nao encaixa\n");
}
}