返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     char a1[4]="abc";
  7.     char a2[3]={'a','b','c'};
  8.     string b1="abc";
  9.     string b2[2]={"ab","c"};
  10.     int a=1;
  11.     char c='x';
  12.     cout<<a1<<endl;
  13.     for(int i=0;i<=3;i++)
  14.     {
  15.         cout<<a2[i];        
  16.     }
  17.     cout<<endl;
  18.     cout<<b1<<endl;
  19.     for(int i=0;i<3;i++)
  20.     {
  21.         cout<<b2[i];        
  22.     }
  23.     cout<<endl;
  24.     cout<<a<<endl;
  25.     cout<<c<<endl;
  26.     system("pause");
  27.     return 0;
  28. }
複製代碼

TOP

返回列表