Ex. 5.3 — Strings
You cannot submit for this problem because the homework's deadline is due.
Description
Write a program to find the number of times a given string occurs in a sentence. The user will input both the sentence and the word.
Format
Files
GNUMake
If you choose GNUMake, then you should compress assignment.h
, ex1.c
, ex2.c
, ex3.c
, ex4.c
, main.c
, Makefile
directly into a zip and submit this zip. (A sample Makefile
can be found on Canvas).
If you just finished ex1 and you immediately want to test whether your ex3 is working correctly. You need to modify your main.c
, assignment.h
, Makefile
(delete ex2.c ex1.c ex4.c) and then compress main.c
,assignment.h
,Makefile
,ex3.c
into a zip and submit this zip.
The sample Makefile
on Canvas has -o main
, do not change this main
!
CMake
If you choose CMake, then you should compress assignment.h
, ex1.c
, ex2.c
, ex3.c
, ex4.c
, main.c
, CMakeLists.txt
directly into a zip and submit this zip. (A sample CMakeLists.txt
can be found on Canvas).
If you just finished ex3 and you immediately want to test whether your ex3 is working correctly. You need to modify your main.c
, assignment.h
, CMakeLists.txt
(delete ex2.c ex1.c ex4.c) and then compress main.c
,assignment.h
,CMakeLists.txt
,ex3.c
into a zip and submit this zip.
The sample CMakeLists.txt
on Canvas has add_executable(main ...
, do not change this main
! Also, do not change cmake_minimum_required(VERSION 2.7)
Input
two lines, the sentence on the first and the word on the second
the max length of the sentence and the word is 10000
Output
two lines of prompts and one line showing the result
Sample 1
Input
good morning, have you seen the cat and the dog?
the
Output
The string 'the' occurs 2 times
Limitation
1s, 32MiB for each test case.
Homework 5 (Group)
- Status
- Finished
- Problems
- 4
- Open Since
- 2019-10-29 00:00
- DDL
- 2019-11-01 23:59
- Extension
- 24.0 hour(s)