#include <stdio.h>
#include <stdlib.h>
int d;

char * r()
{
     char * nameStr = (char *)malloc(sizeof(char)*d);
     gets(nameStr);
     return nameStr;
}

int main() {
    char * name;

    scanf("%d", &d);
    name=r();
    int y[d];
    int t=0;
    for(int i=1; i<d; i++)
    {
        
        if(name[i]==' ')
        {
            y[t]=i;
            t++;
        }
    }
    for(int i=t; i>0; i--)
    {
        printf("%d ", y[i]);
        for(int i=1; i<d; i++)
        {
            
        }
    }
    t=0;









    
    // for(int i=d; i>0; i--)
    // {
    //     if(i==y[t])
    //     {
            
    //     }
    //     t++;
    //     printf("%c",name[i]);
    // }
    //printf("name: %s %d \n",name,d);


    free(name);
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: