-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathComplete_string.c
More file actions
54 lines (47 loc) · 903 Bytes
/
Complete_string.c
File metadata and controls
54 lines (47 loc) · 903 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
44
45
46
47
48
49
50
51
52
53
54
#include<stdio.h>
#include<string.h>
int main()
{
char str[150],g;
int t,l,i,k,j,flag=1,flag2=0;
scanf("%d", &t);
for(k=0;k<=t;k++)
{
flag2=0;
gets(str);
l=strlen(str);
if(l<26)
flag2=1;
else
{
for(i=0;i<l-1;i++)
{
for(j=1;j<l;j++)
{
if(str[i]==str[j])
{
str[i]=str[i+1];
l--;
j--;
}
}
}
}
puts(str);
if(l==26)
flag2=0;
if(flag==1)
{
flag++;
continue;
}
else
{
if(flag2==1)
printf("NO\n");
else
printf("YES\n");
}
}
return 0;
}