eng
competition

Text Practice Mode

Programming text C

created Jan 25th 2021, 06:54 by PraveenKumarSirimand


1


Rating

66 words
52 completed
00:00
#include<stdio.h>
 
#include<string.h>
 
int main() {
 
char s[1000];
 
scanf("%s", s);
 
int i, k, j, n;  
 
n = strlen(s); k=n-1;
 
if(n%2 != 0)  
 
for(i=0; i<n; i++) {
 
for(j=0; j<n; j++) {
 
   if(j==i)  printf("%c", s[i]);
 
   if(j==k && i!=k)  printf("%c", s[k]);
 
   if(j!=i && j!=k) printf (" ");
 
    } k-- ; printf("\n");
 
}
 
else printf("INVALID");
 
    return 0;
 
}
 
 
 
 
 

saving score / loading statistics ...