首页 > > 详细

讲解C、C辅导、辅导C程序、C编程辅导、辅导C程序

Programming Project 2




• linked list





•“”
•“”()
•,
•Substitution node ID node ID。
• node , node ()
• Sch ,
• stdlib.h String.h
• List
Sub ,

()( sample_input.txt )
•:
•:, del, sub, sch
•del xxxx
• xxxx
•sub xxxx yyyy
• yyyy xxxx
•sch xxxx
• xxxx
• xxxx
• sch

• sample_input.txt
I want to play music .
sub play clay
sch clay
del I
del music
sch .
0
• Sch , 0,
• Sub , xxxx ,
• del xxxx ,
• Sch xxx, x ID
ID
• Sch , ID 。
id
• 0

init_id:
0 I
1 want
2 to
3 play
4 the
5 pop
6 music
7 of
8 M.C.
9 Baba.
10 everyday
11 in
12 this
13 semester
14 without
15 interrupt.
16 It
17 may
18 be
19 impossible
20 achieve
21 goal
22 Seoul.
23 need
24 go
25 my
26 hometown
27 Jeju.

• sample_input.txt :
I want to play the pop music of M.C. Baba. everyday in this semester without interrupt. It may be impossible to achieve this goal in Seoul. I need to go to my hometown Jeju.

sch I
sch you
sub M.C. m.c.
sch m.c.
sub my may
sch my
del may
del my
del music
sch music
sub the might
sch the
0
• Sample_output.txt :
0
6 17 25 8
6 17 8
8
2 12


#!/bin/bash
if ! [ -f ./compile.sh ] ; then
echo "No compile.sh file."
else
rm project1.out err res
./compile.sh
if ! [ -f ./project1.out ] ; then
echo "project1.out is not created."
fi
./project1.out err

diff err sample_output.txt > res
size=`du ./res | cut -f 1`
if [ $size == 0 ] ; then
echo "Success"
else
echo "Fail"
fi
fi

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!