Problem link :
https://www.urionlinejudge.com.br/judge/en/problems/view/1272
Solution :
https://www.urionlinejudge.com.br/judge/en/problems/view/1272
Solution :
#include <stdio.h>
int
main()
{
char
str[1000],str1[1000];
int
i,j,k,l,n;
scanf
(
"%d"
,&n);
getchar
();
while
(n--)
{
gets
(str);
j =
strlen
(str);
k=0;
for
(i=0;i<j;i++)
{
if
(i == 0 && str[0]!=
' '
) {
str1[k] = str[0];
k++;
}
if
(str[i]==
' '
&& str[i+1] ==
' '
)
continue
;
if
(str[i]==
' '
&& str[i+1] !=
' '
)
{
str1[k] = str[i+1];
k++;
}
}
str1[k] =
'\0'
;
printf
(
"%s\n"
,str1);
}
}
thanks man !
ReplyDelete#include
ReplyDelete#include
int main()
{
int t,i,j;
scanf("%d", &t);
char s[51];
for(i=0;i='a'&&s[j]<='z')printf("%c", s[j]);
}
else if((s[j]<'a'||s[j]>'z')&&(s[j+1]>='a'&&s[j+1]<='z'))
{
printf("%c", s[j+1]);
}
}
printf("\n");
}
return 0;
}