返回列表 發帖
  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.    
  23. system("pause");   
  24. return 0;   
  25. }
複製代碼

TOP

返回列表