#31009: 用字串來寫結果67%的可以來看看


leslie100791 (魚在地上爬)


有一個測資是0到底(應該是),所以記得加個條件判斷

以下是我的寫法 可以參考

#include<stdio.h>
int main()
{
    char num[10000];
    int count=0,judge=0;
    scanf("%s",num);
    for(count=0;num[count]!='\0';count++)
    {
    }
    count--;
    while(count>=0)
    {
        if(num[count]!='0')
        {
            judge++;
        }
        if(judge>0)
        {
            printf("%c",num[count]);
        }
        count--;
    }
    if(judge==0) //G8測資
    {
        printf("0");
    }