Problem Code:ENCMSG
Contest Code:Practice
Status:Correct Answer
Language : C(NOTE : Try a few times yourself before moving to the solution)
Problem Code:
ENCMSGContest Code:Practice
Status:
Correct Answer
#include <stdio.h>
int main(void) {
int t;
scanf("%d\n",&t);
while(t--)
{
int num;
scanf("%d\n",&num);
char s[num];
scanf("%s\n",&s);
for(int i = 0; i < num-1; i+=2)
{
char temp;
temp = s[i+1];
s[i+1] = s[i];
s[i] = temp;
}
for(int i = 0; i < num; i++)
{
char temp = s[i];
printf("%c",'z'-temp+'a');
}
printf("\n");
}
return 0;
}
No comments:
Post a Comment