POJ 2876
1 #include<iostream> 2 #include<string> 3 using namespace std; 4 5 string s[13]; 6 7 int main() 8 { 9 //freopen("acm.acm","r",stdin); 10 string tem; 11 int i; 12 s[0] = "-"; 13 for(i = 1; i < 13; ++ i) 14 { 15 s[i] += s[i-1]; 16 s[i] += s[i-1]; 17 s[i] += s[i-1]; 18 fill_n(s[i].begin()+s[i-1].length(),s[i-1].length(),' '); 19 } 20 while(cin>>i) 21 { 22 cout<<s[i]<<endl; 23 } 24 }