45分蒟蒻求助....
查看原帖
45分蒟蒻求助....
486331
Ustinian_楼主2021/4/2 08:26
#include<stdio.h>
#include<string.h>
int main()
{
    int i=0,j=0;
    char s[200]={0};
    scanf("%s",s);
    for(i=strlen(s)-1;i>=0;i--){
        if(s[i]=='.')
        break;
        else if(s[i]=='/')
        break;
        else if(s[i]=='%')
        break;
    }
    if(s[i]=='.'||s[i]=='/'||s[i]=='%'){
        for(j=i-1;j>=0;j--){
            if(s[j]=='0')
            continue;
            else
            printf("%c",s[j]);
        }
        printf("%c",s[i]);
        for(j=strlen(s)-1;j>i;j--){
            if(s[j]=='0')
            continue;
            else
            printf("%c",s[j]);
        }
    }
    else{
        for(i=strlen(s)-1;i>=0;i--){
             printf("%c",s[i]);
        }
    }
    return 0;
}
2021/4/2 08:26
加载中...