3 solutions

  • 2
    @ 2023-10-25 16:30:55
    #include <bits/stdc++.h>
    using namespace std;
    
    void Print(const char * p1, const char * p2) {
        for(;p1 != p2;p1++)// 在该行补充你的代码
            cout << * p1;
    }
    
    int main() {
        const char * s = "Zhixin123";
        Print(s, s + 6);
        cout << endl;
        Print(s, s + 3);
        cout << endl;
        return 0;
    }
    
    • 0
      @ 2024-9-22 17:54:35
      #include<iostream>
      #include<queue>
      #include<stack>
      #include<cmath>
      #include<algorithm>
      #include<cstring>
      using namespace std;
      int main()
      {
      	string a="Zhixin",b="Zhi ";
      	string *c=&a,*d=&b;//赋值
      	cout<<*c<<endl<<*d;//输出要加“*”号
      	return 0;
      
      }
      
      

      不要抄哦._.

      • 0
        @ 2023-11-4 14:58:39

        #include <bits/stdc++.h> using namespace std;

        void Print(const char * p1, const char * p2) { for(p1;*p1!=*p2/直到p1所指的数等于p2为止/;p1++) cout << * p1; }

        int main() { const char * s = "Zhixin123"; Print(s, s + 6); cout << endl; Print(s, s + 3); cout << endl; return 0; }

        • 1

        Information

        ID
        920
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        2
        Tags
        # Submissions
        81
        Accepted
        52
        Uploaded By