Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <unistd.h>
- void ft_putchar(char c);
- void rush(int C, int L);
- int main(){
- rush(5,4);
- return (0);
- }
- void ft_putchar(char c){
- write(1, &c, 1);
- }
- void rush(int C, int L){
- int i;
- int j;
- i = 1;
- while(i<=L){
- j = 1;
- while(j<=C){
- if((i==1 && j==1) || (j == C && i==1) || (j==1 && i==L) || (j== C && i== L)){
- if((i==1 && j == C && C !=1) || (j==1 && i == L && L != 1)){
- ft_putchar('C');
- }else{
- ft_putchar('A');
- }
- }
- else if((i==1 || i==L) || ((i != 1 && i != L) && (j==1 || j == C))){
- ft_putchar('B');
- } j++;else{
- ft_putchar(' ');
- }
- j++;
- }
- ft_putchar('\n');
- i++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement