5 solutions

  • 5
    @ 2024-8-3 15:00:53
    #include<bits/stdc++.h>
    using namespace std;
    const int N=10010;
    char a[N];
    int main()
    {
    	cin.getline(a,N);
    	int n=strlen(a);
    	for (int i=0;i<n;i++)
    	{
    		if (a[i]==' ')
    		{
    			continue;
    		}
    		int j=i;
    		while(j<n&&a[j]!=' ') j++;
    		j--;
    		int len=j-i+1;
    		if (i==0) cout<<len;
    		else cout<<","<<len;
    		i=j;
    	}
    	return 0;
    }
    
    • -2
      @ 2025-1-12 10:15:53
      #include<bits/stdc++.h>
      using namespace std;
      const int N=210;
      char s1[N],s2[N];
      int main()
      {
      	cin.getline(s1,N);
      	int n=strlen(s1);
      	int cnt=0;
      	for(int i=0;i<n;i++)
      	{
      		if(s1[i]==' ')
      		{
      			continue;
      		}
      		else
      		{
      			int j=i;
      			s2[cnt++]=s1[i];
      			while(j<n&&s1[j]!=' ') j++;
      			j--;
      				int k=j-i+1;
      				i=j;
      				cout<<k;
      				if(i==n-1)
      				{
      					return 0;
      				}
      				else
      				{
      					cout<<",";
      				}
      		}	
      	}
      	return 0;
      }
      
      • -4
        @ 2024-7-27 15:12:35

        NMWJ

        • -4
          @ 2024-7-24 14:51:10

          WQDSF

          • -8
            @ 2024-5-19 10:45:17
            #include<bits/stdc++.h>
            using namespace std;
            const int main()
            {
                cout<<"10";
                return 0;🤣😅😂🤣😅😂🤣😅😂🤣别当真```b
            
            • 1

            Information

            ID
            86
            Time
            1000ms
            Memory
            256MiB
            Difficulty
            3
            Tags
            # Submissions
            80
            Accepted
            28
            Uploaded By