Skip to content

Instantly share code, notes, and snippets.

@bitwiser
Created March 6, 2014 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitwiser/9397686 to your computer and use it in GitHub Desktop.
Save bitwiser/9397686 to your computer and use it in GitHub Desktop.
#include<iostream>
#include<cstdio>
#include<vector>
#define SIZE 2
using namespace std;
int main(){
const char *animal[] = {"Dog","Cat"};
const char *sound[] = {"woof","meow"};
const char *out = "Old McDonald had a farm\n"
"E I E I O\n"
"and on that farm he had a %s\n"
"E I E I O\n"
"With a %s %s here\n"
"and a %s %s there"
"here's a %s\n"
"there's a %s\n"
"everywhere a %s %s\n"
"Old McDonald had a farm\n"
"E I E I O\n\n";
for(int i=0;i<SIZE;i++){
printf(out, animal[i], sound[i], sound[i], sound[i], sound[i],sound[i],sound[i],sound[i],sound[i]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment