<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ``` #include <iostream> #include <string> using namespace std; int main(){ // string name="ZhangSan"; // string hobby("football"); // cout<<name<<hobby<<endl; // -------------------------------------- // 初始化string對象的方式 // string s1;//s1為空字符串 // string s2("ABC");//用字符串字面值初始化s2 // string s3(s2);//將s3初始化為s2的一個副本 // string s4(n,'4');//將s4初始化為字符'c'的n個副本 //---------------------------------------- // string常用操作 // s.empty();//若s為空串,則返回true,否則返回false // s.size();//返回s中字符的個數 // s[n];//返回s中位置為n的字符,位置從0開始 // s1+s2;//將兩個字符串連接成新串,返回新生成的串 // s1=s2;//將s1的內容替換為s2的副本 // v1==v2;//判定相等,相等返回true,否則返回false // v1!=v2 //判定不等,不等返回true,否則返回false //------------------------------------------------- // string s1="hello"; // string s2("world"); // string s3=s1+s2; // string s4="hello" +s2; // string s5="Hello "+s2+"world"; // string s6="hello "+"world";//錯誤方式 /**-------------------------------------- * 題目描述: * 1.提示用戶輸入姓名 * 2.接收用戶的輸入 * 3.然后向用戶問好,hello xxx * 4.告訴用戶名字的長度 * 5.告訴用戶名字的首字母是什么 * 6.如果用戶直接輸入回車,那么告訴用戶的輸入為空 * 7.如果用戶輸入的是admin,那么告訴用戶的角色是一個管理員 */ string name; cout<<"please input your name:"; // 接收用戶輸入 getline(cin,name); if(name.empty()){ cout<<"input is null..."<<endl; system("pause"); return 0; } if(name=="admin"){ cout<<"you are a administrator"<<endl; } cout<<"hello "+name<<endl; cout<<"your name length:"<<name.size()<<endl; cout<<"your name first letter is "<<name[0]<<endl; system("pause"); return 0; } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看