2 条题解

  • 4
    @ 2024-10-5 17:21:19

    众所周知,lgn=d1\lfloor\lg n\rfloor=d-1,其中 ddnn 的数字位数。

    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
    	freopen("log.in", "r", stdin);
    	freopen("log.out", "w", stdout);
    	int cnt = 0;
    	char c = getchar();
    	while(c != EOF) cnt++, c = getchar();
    	printf("%d", cnt - 1);
    	return 0;
    }
    
    • 3
      @ 2024-12-7 13:48:07
      #include<bits/stdc++.h>
      using namespace std;
      int main(){
          freopen("log.in","r",stdin);
          freopen("log.out","w",stdout);
          char a=getchar();
          int ans=-1;
          while(a!=EOF){
              ans++;
              a=getchar();
          }
          cout<<ans;
          fclose(stdin);
          fclose(stdout);
          return 0;
      }
      
      • 1

      信息

      ID
      6
      时间
      1000ms
      内存
      512MiB
      难度
      2
      标签
      递交数
      33
      已通过
      9
      上传者