#include <stdio.h>
#include <string.h>
#define MAX_BUF 1024

int main () {

  char buf[MAX_BUF];
  int length;
  // other stuff

  do {
        // read a line
        // calculate its length
        // modify the line by switching characters
        // print the modified line
  } while (length > 1);

}
