Ex. 6.3 — Strings and file I/O
You cannot submit for this problem because the homework's deadline is due.
Upload file
Just compress your ex3.c
, which has #include "assignment.h"
and doesn't has main()
function and has function prototype as void ex3()
, and upload the compressed zip
Description
Write a program to find the number of times a given word occurs in a sentence. The program should read the sentence from a file called sentence.txt
and the word from a file called word.txt
. The output should be printed in a file count.txt
.
Format
Files
You should submit a tar file containing a c source file ex3.c
which contains a function void ex3()
that realizes the requirement as is specified in the description.
Input Files
a sentence in sentence.txt
and a word in word.txt
the length of one line is less than 10000
Output Files
an integer in count.txt
Sample 1
Input: sentence.txt
letter from a birmingham jail king jr 16 april 1963 my dear fellow clergymen while confined here in the birmingham city jail i came across your recent statement calling my present activities unwise and untimely seldom do i pause to answer criticism of my work and ideas if i sought to answer all the criticisms that cross my desk
Input: word.txt
i
Output: count.txt
3
Limitation
1s, 32MiB for each test case.
Homework 6 (Individual)
- Status
- Finished
- Problems
- 6
- Open Since
- 2019-11-03 00:00
- DDL
- 2019-11-08 23:59
- Extension
- 240.0 hour(s)