Auto commit

This commit is contained in:
smallkun 2025-04-01 16:36:23 +08:00
parent fc66b14900
commit da63a1d634
2 changed files with 29 additions and 5 deletions

View File

@ -29,12 +29,32 @@ char *fun(char input[])
} }
int outputIndex = 0; int outputIndex = 0;
/**********Program**********/ /**********Program**********/
int i; int i, s=0, t=1, j, k;
for(i=0;i<len;i++){ for(i=0;i<len;i++){
while(input[i]=='['){ if(input[i] == '['){
s = 0;
t = 1;
while(input[i+1] >= '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<s;j++){
k = i;
while(input[k] != ']'){
output[outputIndex++] = input[k];
k++;
}
}
} }
} }
output[outputIndex] = '\0';
/********** End **********/ /********** End **********/
return output; return output;
} }

View File

@ -20,7 +20,11 @@ int main()
int money = 100; int money = 100;
int year = 1; int year = 1;
/**********Program**********/ /**********Program**********/
while(money > 0){
money = money + money*0.04;
money -= 10;
year++;
}
/********** End **********/ /********** End **********/
printf("%d 年后账户上的钱会被花完", year); printf("%d 年后账户上的钱会被花完", year);
printf("\n"); printf("\n");