返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     char n1[5]="tony";
  7.    
  8.     char n2[4]={'t','o','n','y'};
  9.    
  10.     string n3[2]={"to","ny"};
  11.    
  12.     string n4="tony";
  13.    
  14.     cout<<n1<<endl;
  15.     for(int i=0;i<4;i++)
  16.     {
  17.        cout<<n2[i];               
  18.     }
  19.     cout<<endl;
  20.     for(int i=0;i<2;i++)
  21.     {
  22.        cout<<n3[i];               
  23.     }
  24.     cout<<endl;
  25.     cout<<n4<<endl;
  26.     system("pause");
  27.     return 0;   
  28. }
複製代碼

TOP

返回列表