xiaochige

 

 1 #include<iostream>
 2 #include<string.h>
 3 using namespace std;
 4 
 5 
 6 int main()
 7 {
 8     string a ="12345";
 9     //string b ={1,2,3,4,5};这种初始化的方法是错误的
10     for(int i =0;i<4;i++)
11     cout<<a[i];
12     system("pause");
13 }

 

 

 

 

 

 

 

 

 

 

 

1 int main()
2 {
3     string a ="1,2,3,4,5";
4     for(int i =0;i<4;i++)
5     cout<<a[i];
6     system("pause");
7 }

 

分类:

技术点:

相关文章:

  • 2021-09-19
  • 2021-09-19
  • 2021-11-05
  • 2021-09-19
  • 2021-03-06
  • 2021-12-15
  • 2021-04-05
猜你喜欢
  • 2021-10-28
  • 2021-06-17
  • 2021-12-09
  • 2021-11-05
  • 2021-09-19
  • 2021-05-27
  • 2021-09-19
相关资源
相似解决方案