snippets/c/cecho.c

16 lines
312 B
C
Raw Normal View History

2023-01-11 19:27:06 +03:00
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
for (int i = 1; i < argc; i++) {
printf("\033[%dm%s", i % 2, argv[i]);
if (i != argc - 1)
putchar(' ');
}
2023-01-15 21:46:56 +03:00
puts("\033[0m");
2023-01-11 19:27:06 +03:00
}
2023-01-15 21:44:47 +03:00
// Compilation: cc cecho.c -o cecho
// Usage: ./cecho [STRING]...
2023-01-11 19:27:06 +03:00
// License: Public Domain