Created
October 7, 2016 06:05
-
-
Save kantale/adaa5b5eaf7df25741d752774773f2de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* | |
/A\ | |
//A\\ | |
///A\\\ | |
\\\A/// | |
\\A// | |
\A/ | |
*/ | |
int main() { | |
int N = 3; | |
int i, j; | |
//The top part | |
for (i=0; i<N; i++) { | |
// Spaces | |
for (j=0; j<N-i-1; j++) { | |
putchar(' '); | |
} | |
// Slash (/) | |
for (j=0; j<i+1; j++) { | |
putchar('/'); | |
} | |
// A | |
putchar('A'); | |
// Backslash (\) | |
for (j=0; j<i+1; j++) { | |
putchar('\\'); | |
} | |
//New line | |
putchar('\n'); | |
} | |
// The bottom part | |
for (i=0; i<N; i++) { | |
//Spaces | |
for (j=0; j<i; j++) { | |
putchar(' '); | |
} | |
// Backslash | |
for (j=N-i; j>0; j--) { | |
putchar('\\'); | |
} | |
// A | |
putchar('A'); | |
// Slash / | |
for (j=N-i; j>0; j--) { | |
putchar('/'); | |
} | |
//New line | |
putchar('\n'); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment