2 条题解

  • 1
    @ 2026-5-23 17:40:50

    对于这道题,我们可以使用strlen()函数,它的作用是求字符串的长度,在有这个函数的情况下,这道题就变得很简单啦~ 代码如下:

    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
    	char n[35486]="";
    	cin>>n;
    	int len=strlen(n);
        cout<<len;
    	return 0;
    }
    
    • 1
      @ 2025-7-31 7:24:54
      #include <iostream>
      #include <cstdio>
      using namespace std;
      int main()
      {
          string s;
          cin>>s;
          cout<<s.size();
          return 0;
      }
      
      
      • 1

      信息

      ID
      171
      时间
      1000ms
      内存
      256MiB
      难度
      2
      标签
      (无)
      递交数
      65
      已通过
      38
      上传者