test

来源:互联网 发布:nomachi是什么软件 编辑:程序博客网 时间:2024/06/14 02:59

 简单编程:

    

  1. #include <string>
  2. #include <iostream>
  3. using namespace std;
  4. void main()
  5. {
  6.     string str;
  7.     string str1;
  8.     getline(cin,str);
  9.     getline(cin,str1);
  10.     cout<<str<<endl;
  11.     cout<<str1<<endl;
  12.     int b=strlen(str1.data());
  13.     strcpy(const_cast<char*>(str.data()),str1.data());
  14.     int a;
  15.     a=atoi(str.c_str());
  16.     cout <<a<<b<<str<<endl<<str1<<strlen(str.data())<<endl;
  17. }