3 条题解

  • 4
    @ 2024-11-16 15:57:58

    这才是认真作弊🎉️

    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    #include <ctype.h>
    #define MAXN 300000
    char s[MAXN];
    int main(){
    	fgets(s,sizeof(s),stdin);
    	int cnt = 0 ;
    	int len = strlen(s);
    	int flag = 1 , d = 0;
    	for(int i = 0;i<len;i++){
    		if(isalpha(s[i])){
    			if(0-flag!=0)cnt++;
    			flag = 0;
    			d++;
    		}else{flag = 1;}
    	}
    	printf("%.1lf\n",d,cnt,1.0*d/cnt);
    	return 0;
    }
    
    • 2
      @ 2025-3-14 19:50:05

      made in China

      #include <stdio.h>
      	#include <iostream>
      	#include <string.h>
      	using namespace std;
      	char a[289819];
      	int main()
      	{
      		double sum = 0 , l = 0;
      		while(cin >> a)
      		{
      			l++;
      			sum += strlen(a);
      		 } 
      		 printf("%.1lf\n",sum/l);
      	}
      
      • 2
        @ 2024-11-16 13:45:51

        点赞吧

        allright

        #include<bits/stdc++.h>
        #define int long long
        #define INF 0x3f3f3f3f
        #define INFSHORT 1e+3
        #define INFINT 1e+10
        #define INFLONGLONG 1e+19
        using namespace std;
        char a[1919180];
        double sum,l;
        signed main(){
        	while(cin>>a){
        		sum+=strlen(a);
        		l++;
        	}
        	cout<<fixed<<setprecision(1)<<sum/l;
        	return 0;
        }
        
        • 1

        信息

        ID
        1094
        时间
        1000ms
        内存
        128MiB
        难度
        8
        标签
        递交数
        655
        已通过
        121
        上传者