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

TOP

返回列表