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

返回列表