返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    char n1[5]="kaka";   
  7.     char n2[4]={'k','a','k','a'};  
  8.     string n3[2]={"ka","ka"};   
  9.     string n4="kaka";   
  10.     int a=5;      
  11.     char c='k';   
  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.    
  26. }
複製代碼

TOP

返回列表