#include<iostream>
#include<cstring>
using namespace std;
void main(){
const char*state1="florida";
const char*state2="kansas";
const char*state3="euphoria";
int len=strlen(state2);
cout<<"increasing loop index;\n";
int i;
for(i=1;i<=len;i++){
  cout.write(state2,i);
  cout<<endl;
}
cout<<"decreasing loop index:\n";
for(i=len;i>0;i--)
   cout.write(state2,i)<<endl;
cout<<"exceeding string length:\n";
   cout.write(state2,len+5)<<endl;


}

posted on 2013-02-23 15:40  叶城宇  阅读(360)  评论(0编辑  收藏  举报