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

TOP

返回列表