Skip to content

Instantly share code, notes, and snippets.

@fclairamb
Created September 11, 2013 08:59
Show Gist options
  • Save fclairamb/6521071 to your computer and use it in GitHub Desktop.
Save fclairamb/6521071 to your computer and use it in GitHub Desktop.
#ifdef SHELL
gcc -Wall -Werror $0 && ./a.out 10
exit 0
#endif
#include <stdio.h>
#include <stdlib.h>
int main( int argc, char * argv [] ) {
int size = atoi(argv[1]);
char data[size+1];
data[size] = '\0';
int i;
for( i = 0; i < size; i++ ) {
if ( i%2 == 0 )
data[i] = 'A' + (i/2)%('9'-'0');
else
data[i] = 'T';
}
printf("Result = %s\n", data);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment