diff --git a/万维调考试题源码/10-2.c b/万维调考试题源码/10-2.c index 0940bfb..7cb9f59 100644 --- a/万维调考试题源码/10-2.c +++ b/万维调考试题源码/10-2.c @@ -29,12 +29,32 @@ char *fun(char input[]) } int outputIndex = 0; /**********Program**********/ - int i; + int i, s=0, t=1, j, k; for(i=0;i= '0' && input[i+1] <= '9'){ + i++; + } + while(input[i] != '['){ + s+=(input[i]-48)*t; + t*=10; + i--; + } + i++; + while(input[i] >= '0' && input[i] <= '9') i++; + for(j=0;j 0){ + money = money + money*0.04; + money -= 10; + year++; + } /********** End **********/ printf("%d ˻ϵǮᱻ", year); printf("\n"); return 0; -} \ No newline at end of file +}