Created
March 6, 2014 19:36
-
-
Save bitwiser/9397686 to your computer and use it in GitHub Desktop.
This file contains hidden or 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<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