Quick actions

cmd+k|ctrl+k

Navigation

Languages

rush00

Snippet info

Language

C

Visibility

public

Author

jqw

Created

2020-10-16T12:30:58Z

Updated

2020-10-16T12:31:39Z


#include <stdio.h>
void rush(int x, int y);
int main(void)
{
    rush(5, 5);
    
    return 0;
}
void rush(int x, int y)
{
    for (int i = 0; i < y; ++i){
        for (int j = 0; j < x; ++j){
            if ( (i == 0 && j == 0)
                || (i == 0 && j == x - 1)
                || (i == y - 1 && j == 0)
                || (i == y - 1 && j == x - 1)){
                printf("o");
            }
            else if (i == 0 || i == y - 1){
                printf("-");
            }
            else if (j == 0 || j == x - 1){
                printf("|");
            }
            else{
                printf(" ");
            }
        }
        printf("\n");
    }
}
INFO