-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsodaydu.c
More file actions
43 lines (43 loc) · 732 Bytes
/
sodaydu.c
File metadata and controls
43 lines (43 loc) · 732 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
40
41
42
43
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
void test(char s[])
{
bool check[10] = {false};
int len = strlen(s);
if (s[0] - 48 == 0)
{
printf("INVALID\n");
return;
}
for (int i = 0; i < len; i++)
{
if (s[i] < 48 || s[i] > 57)
{
printf("INVALID\n");
return;
}
check[s[i] - 48] = true;
}
for (int i = 0; i < 10; i++)
if (check[i] == false)
{
printf("NO\n");
return;
}
printf("YES\n");
return;
}
int main()
{
int t;
scanf("%d", &t);
getchar();
while (t--)
{
char s[1000];
gets(s);
test(s);
}
return 0;
}