PROGRAMMING:Code layout
There is a challenge in the design of a programming contest. Players can check the code of other players and submit a set of test data after finding the error. In order to reduce the chance of being challenged, some players will deliberately make the code difficult to understand, such as removing all carriage returns and submitting programs with all contents in one line, which makes challengers fear.
In order to deal with this kind of player, now please write a code typesetting program, which will be written as a one line program. Of course, it's too difficult to write a perfect typesetting program. Here, we only need to deal with the three special structures of for, while and if else in C language, and treat all other sentences as sequential sentences. The output requirements are as follows:
-There is no indentation at the beginning of the default program; Each indent level is 2 spaces;
-At the beginning of each line, except for the specified indented space, no extra space is output;
-The body of a program executed in sequence is marked with a semicolon At the end of the semicolon on the line;
-When the program body in a pair of braces "{" and "}" is output, the braces at both ends occupy a single line, and each line of the internal program body is indented by one level
```
{
Program body
}
```
-The format of for is:
```
For (condition){
Program body
}
```
-The format of while is:
```
While (condition){
Program body
}
```
-The format of if else is:
```
If (condition){
Program body
}
else {
Program body
}
```
###Input format:
Enter a non empty string that gives no more than 331 characters on a line, ending with a carriage return. The topic guarantees that the input is a main function module with correct syntax and can be compiled and run normally.
###Output format:
According to the required format, output the program after typesetting.
###Input example:
```in
int main() {int n, i; scanf("%d", &n); if( n>0)n++; else if (n<0) n--; else while(n<10)n++; for(i=0; i```
###Output example:
```out
int main()
{
int n, i;
scanf("%d", &n);
if ( n>0) {
n++;
}
else {
if (n<0) {
n--;
}
else {
while (n<10) {
n++;
}
}
}
for (i=0; iprintf("n=%d\n", n);
}
return 0;
}
```
answer:If there is no answer, please comment
In order to deal with this kind of player, now please write a code typesetting program, which will be written as a one line program. Of course, it's too difficult to write a perfect typesetting program. Here, we only need to deal with the three special structures of for, while and if else in C language, and treat all other sentences as sequential sentences. The output requirements are as follows:
-There is no indentation at the beginning of the default program; Each indent level is 2 spaces;
-At the beginning of each line, except for the specified indented space, no extra space is output;
-The body of a program executed in sequence is marked with a semicolon At the end of the semicolon on the line;
-When the program body in a pair of braces "{" and "}" is output, the braces at both ends occupy a single line, and each line of the internal program body is indented by one level
```
{
Program body
}
```
-The format of for is:
```
For (condition){
Program body
}
```
-The format of while is:
```
While (condition){
Program body
}
```
-The format of if else is:
```
If (condition){
Program body
}
else {
Program body
}
```
###Input format:
Enter a non empty string that gives no more than 331 characters on a line, ending with a carriage return. The topic guarantees that the input is a main function module with correct syntax and can be compiled and run normally.
###Output format:
According to the required format, output the program after typesetting.
###Input example:
```in
int main() {int n, i; scanf("%d", &n); if( n>0)n++; else if (n<0) n--; else while(n<10)n++; for(i=0; i
###Output example:
```out
int main()
{
int n, i;
scanf("%d", &n);
if ( n>0) {
n++;
}
else {
if (n<0) {
n--;
}
else {
while (n<10) {
n++;
}
}
}
for (i=0; i
}
return 0;
}
```
answer:If there is no answer, please comment