2 条题解

  • 0
    @ 2025-10-13 22:46:00

    //(注这是一种错误方法过不了哈,别复制) 为什么这种方法过不了啊,想了三个小时才写出来,因为输入调用了30遍系统,变得贼慢,心态崩溃了,那个死豆包还一直说我错,说着说着发现是自己错了,deepseek还靠谱点,气死,找不到人吐槽了,在这发发牢骚吧 #include<stdio.h>

    int main() { int a[26]; int asd=0 for(int i=0;i<26;i++) a[i]=(i+1)*100; char mop[31]; scanf("%31s",mop); char c; while(c=mop[asd])&&c!='\n') { a[c-97]++; asd++; } for(int i=0;i<25;i++) { int m; if(a[i]%100>a[i+1]%100) { m=a[i]; a[i]=a[i+1]; a[i+1]=m; } } printf("%c",(a[25]/100)+96);

    }

    • 0
      @ 2024-11-5 11:26:54

      #include<bits/stdc++.h> using namespace std; int main() { string str;

      cin>>str;
      
      int l=str.size();
      
      int ans[1024]={0};
      
      for(int i=0; i<=l-1; i++)
      {
      	int x=(int)str[i];
      	ans[x]++;
      }
      
      int max=0;
      int step;
      
      for(int i=95; i<=125; i++)
      {
      	if(ans[i]>max)
      	{
      		max=ans[i];
      		step=i;
      	}
      }
      
      char result=(char)step;
      
      cout<<result;
      
      return 0;
      

      }

      • 1

      信息

      ID
      182
      时间
      1000ms
      内存
      256MiB
      难度
      5
      标签
      递交数
      484
      已通过
      171
      上传者