Ex. 6.6 — Conditional statements, loops, pointers, ASCII code
You cannot submit for this problem because the homework's deadline is due.
Upload file
Using C template as before (including Makefile
/CMakeLists.txt
, Assignment.h
, main.c
and corresponding exercise C file).
Description
Write a C program where the user inputs a string and is then offered a menu to replace or delete a character of his choice. The program should then display the initial string with the requested changes applied. When deleting a character use the functions memmove
or memcpy
.
Format
Input
three or four lines: a string on the first, a number on the second, and a character on the third and fourth line
the length of the string is no more than 1,100,000
Output
the prompts and one line with the result
Sample 1
Input:
good morning
1
g
d
Output:
Input a string: * Choose 1 to replace a character or 2 to delete a character: Replace character: with: New string: dood mornind
Sample 2
Input:
good morning
2
g
Output:
Input a string: * Choose 1 to replace a character or 2 to delete a character: Delete character: New string: ood mornin
Limitation
1s, 32MiB for each test case.
Homework 6 (Group)
- Status
- Finished
- Problems
- 6
- Open Since
- 2019-11-04 00:00
- DDL
- 2019-11-10 23:59
- Extension
- 24.0 hour(s)