Problem link :
https://www.urionlinejudge.com.br/judge/en/problems/view/1234
Solution :
#include <stdio.h>
https://www.urionlinejudge.com.br/judge/en/problems/view/1234
Solution :
#include <stdio.h>
int
main()
{
char
str[1000],str1[1000];
int
i,j,k,l,n,m;
while
(
gets
(str) != NULL)
{
k =
strlen
(str);
n=0;
for
(i=0;i<k;i++)
{
if
(str[i] !=
' '
)
{
n++;
if
(n%2 != 0)
{
if
(str[i]>=
'a'
&& str[i]<=
'z'
)
str[i] = str[i] - 32;
else
str[i] = str[i];
}
else
{
if
(str[i]>=
'A'
&& str[i]<=
'Z'
)
str[i] = str[i] + 32;
else
str[i] = str[i];
}
}
}
printf
(
"%s\n"
,str);
}
}
Compilation error dekhay
ReplyDelete