if(strlen(inputtext) == 1) format(str, sizeof(str), ".); if(strlen(inputtext) == 2) format(str, sizeof(str), "..); if(strlen(inputtext) == 3) format(str, sizeof(str), "...); if(strlen(inputtext) == 4) format(str, sizeof(str), "....); if(strlen(inputtext) == 5) format(str, sizeof(str), ".....); if(strlen(inputtext) == 6) format(str, sizeof(str), "......); if(strlen(inputtext) == 7) format(str, sizeof(str), ".......); if(strlen(inputtext) == 8) format(str, sizeof(str), "........); if(strlen(inputtext) == 9) format(str, sizeof(str), ".........); if(strlen(inputtext) == 10) format(str, sizeof(str), "..........);
alguem pode me ajudar a deixar essas linhas em uma se for possivel.
Код:
if(strlen(inputtext) == 1) format(str, sizeof(str), ".); if(strlen(inputtext) == 2) format(str, sizeof(str), "..); if(strlen(inputtext) == 3) format(str, sizeof(str), "...); if(strlen(inputtext) == 4) format(str, sizeof(str), "....); if(strlen(inputtext) == 5) format(str, sizeof(str), ".....); if(strlen(inputtext) == 6) format(str, sizeof(str), "......); if(strlen(inputtext) == 7) format(str, sizeof(str), ".......); if(strlen(inputtext) == 8) format(str, sizeof(str), "........); if(strlen(inputtext) == 9) format(str, sizeof(str), ".........); if(strlen(inputtext) == 10) format(str, sizeof(str), "..........); |
for(new i; i < strlen(inputtext); i++)
format(str, sizeof(str), "%s.", str);
a soluзгo de baixo nгo vai ser tгo ъtil se vocк quiser fazer verificaзхes mesmo...
|
Pense cara, use laзos de repetiзгo, vulgo loops...
PHP код:
Creio que ele quer somente inserir pontos que correspondem ao nъmero de caracteres da string. |
new index;
while(inputtext[index]
{
inputtext[index++] = '.';
}