l9.c update
This commit is contained in:
parent
1ee49b6e78
commit
d71303d054
1 changed files with 5 additions and 5 deletions
10
c/l9.c
10
c/l9.c
|
|
@ -6,11 +6,11 @@ int main() {
|
|||
printf("Enter word ");
|
||||
scanf("%s", pol);
|
||||
int len = strlen(pol);
|
||||
if(len > 50) {
|
||||
printf("Error: too long\n");
|
||||
return 0;
|
||||
for(int i = 0; i < len / 2; i++) {
|
||||
char temp = pol[i];
|
||||
pol[i] = pol[len - 1 - i];
|
||||
pol[len - 1 - i] = temp;
|
||||
}
|
||||
strrev(pol);
|
||||
printf("Reversed: %s\n", pol);
|
||||
printf("%s\n", pol);
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in a new issue