C++ char 转 string,提升速度,快速处理!
#include<iostream>
#include<cstring>
using namespace std;
const int N = 100;
char str1[N], str2[N];
string s1, s2;
int main()
{
scanf("%s%s",str1,str2);
s1 = str1, s2= str2;
cout<<s1<<endl<<s2<<endl;
//只能转为string类型处理,如果想输出sting类型,还是得用到cout,这样速度就又慢了。
// printf("%s\n%s\n",s1,s2);
return 0;
}