返回列表 發帖
  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.     char  c='P';
  9.     string n4="Tony";
  10.     string n5[2]={"To","ny"};
  11.     int a=3;
  12.     cout<<n1<<endl;
  13.     for(int i=0;i<4;i++)
  14.     {
  15.         cout<<n2[i];        
  16.     }
  17.     cout<<endl;
  18.     for(int i=0;i<2;i++)
  19.     {
  20.         cout<<n5[i];        
  21.     }
  22.     cout<<endl;
  23.     cout<<n4<<endl;
  24.     cout<<a<<endl;
  25.     cout<<c<<endl;
  26.     system("pause");
  27.     return 0;   
  28. }
複製代碼

TOP

返回列表