Uri 1234:Dancing Sentence

Problem link

 


Source Code:

#include <stdio.h>

#include <string.h>

int main()

{

char a[1000];

int i,j,k,l,n,m;

while(gets(a) != NULL)

{

k = strlen(a);

n=0;

for (i=0;i<k;i++)

{

if(a[i] != ‘ ‘)

{

n++;

if(n%2 != 0)

{

if(a[i]>=’a’ && a[i]<= ‘z’)

a[i] = a[i] – 32;

else

a[i] = a[i];

}

else

{

if(a[i]>=’A’ && a[i]<= ‘Z’)

a[i] = a[i] + 32;

else

a[i] = a[i];

}

}
}

printf(“%s\n”,a);

}
}

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s