<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=CPP_Study_2005_1%2FBasicBusSimulation%2F%EB%82%A8%EC%83%81%ED%98%91</id>
	<title>CPP Study 2005 1/BasicBusSimulation/남상협 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=CPP_Study_2005_1%2FBasicBusSimulation%2F%EB%82%A8%EC%83%81%ED%98%91"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=CPP_Study_2005_1/BasicBusSimulation/%EB%82%A8%EC%83%81%ED%98%91&amp;action=history"/>
	<updated>2026-05-15T00:55:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=CPP_Study_2005_1/BasicBusSimulation/%EB%82%A8%EC%83%81%ED%98%91&amp;diff=84156&amp;oldid=prev</id>
		<title>Maintenance script: Repair batch-0001 pages from live compare</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=CPP_Study_2005_1/BasicBusSimulation/%EB%82%A8%EC%83%81%ED%98%91&amp;diff=84156&amp;oldid=prev"/>
		<updated>2026-03-26T23:56:03Z</updated>

		<summary type="html">&lt;p&gt;Repair batch-0001 pages from live compare&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:56, 26 March 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l111&quot;&gt;Line 111:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 111:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= thread =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= thread =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 쩝.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 쩝.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=CPP_Study_2005_1/BasicBusSimulation/%EB%82%A8%EC%83%81%ED%98%91&amp;diff=29712&amp;oldid=prev</id>
		<title>imported&gt;Unknown at 05:22, 7 February 2021</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=CPP_Study_2005_1/BasicBusSimulation/%EB%82%A8%EC%83%81%ED%98%91&amp;diff=29712&amp;oldid=prev"/>
		<updated>2021-02-07T05:22:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= CPP_Study_2005_1/BasicBusSimulation/남상협 =&lt;br /&gt;
* 작성자 : 01 남상협&lt;br /&gt;
* 일시 : 05.08.12 10:43&lt;br /&gt;
&lt;br /&gt;
= 데이터 =&lt;br /&gt;
 100 &lt;br /&gt;
 20 30 25 50 30 24 50&lt;br /&gt;
&lt;br /&gt;
= Source =&lt;br /&gt;
 //Simulation.cpp&lt;br /&gt;
 #include &amp;amp;lt;fstream&amp;amp;gt;&lt;br /&gt;
 #include &amp;amp;lt;vector&amp;amp;gt;&lt;br /&gt;
 #include &amp;amp;lt;iostream&amp;amp;gt;&lt;br /&gt;
 #include &amp;quot;BusSimulation.h&amp;quot;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 void main()&lt;br /&gt;
 {&lt;br /&gt;
 	ifstream fin(&amp;quot;data.txt&amp;quot;);&lt;br /&gt;
 	BusSimulation busSimulation(fin);&lt;br /&gt;
 	busSimulation.readBusData();&lt;br /&gt;
 	busSimulation.readTimeInput(cin,cout);&lt;br /&gt;
 	busSimulation.printResult(cout);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 //BusSimulation.h&lt;br /&gt;
 #ifndef _BUS_SIMULATION_H_&lt;br /&gt;
 #define	_BUS_SIMULATION_H_&lt;br /&gt;
 #include &amp;amp;lt;iostream&amp;amp;gt;&lt;br /&gt;
 #include &amp;amp;lt;vector&amp;amp;gt;&lt;br /&gt;
 #include &amp;amp;lt;fstream&amp;amp;gt;&lt;br /&gt;
 #include &amp;quot;Bus.h&amp;quot;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 class BusSimulation {&lt;br /&gt;
 private:&lt;br /&gt;
 	vector&amp;amp;lt;Bus&amp;amp;gt; m_buses;&lt;br /&gt;
 	ifstream &amp;amp;amp;m_fin;&lt;br /&gt;
 	double m_roundDistance;&lt;br /&gt;
 public:&lt;br /&gt;
 	BusSimulation(ifstream &amp;amp;amp;fin) : m_fin(fin) {}&lt;br /&gt;
 	void readBusData();&lt;br /&gt;
 	istream&amp;amp;amp; readTimeInput(istream &amp;amp;amp;in, ostream &amp;amp;amp;out);&lt;br /&gt;
 	void increaseTime(int time);&lt;br /&gt;
 	ostream&amp;amp;amp; printResult(ostream &amp;amp;amp;out);&lt;br /&gt;
 };&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
 //BusSimulation.cpp&lt;br /&gt;
 #include &amp;amp;lt;iostream&amp;amp;gt;&lt;br /&gt;
 #include &amp;amp;lt;fstream&amp;amp;gt;&lt;br /&gt;
 #include &amp;amp;lt;vector&amp;amp;gt;&lt;br /&gt;
 #include &amp;quot;BusSimulation.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 void BusSimulation::readBusData()&lt;br /&gt;
 {&lt;br /&gt;
 	m_fin&amp;amp;gt;&amp;amp;gt;m_roundDistance;&lt;br /&gt;
 	double velocity=0;&lt;br /&gt;
 	while(m_fin&amp;amp;gt;&amp;amp;gt;velocity)&lt;br /&gt;
 	{&lt;br /&gt;
 		Bus bus(velocity,m_roundDistance);&lt;br /&gt;
 		m_buses.push_back(bus);&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
 void BusSimulation::increaseTime(int time)&lt;br /&gt;
 {&lt;br /&gt;
 	for(vector&amp;amp;lt;Bus&amp;amp;gt;::iterator it=m_buses.begin(); it!=m_buses.end(); ++it)&lt;br /&gt;
 		it-&amp;amp;gt;increaseTime(time);&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
 ostream&amp;amp;amp; BusSimulation::printResult(ostream &amp;amp;amp;out)&lt;br /&gt;
 {&lt;br /&gt;
 	for(vector&amp;amp;lt;Bus&amp;amp;gt;::iterator it=m_buses.begin(); it!=m_buses.end(); ++it)&lt;br /&gt;
 		out&amp;amp;lt;&amp;amp;lt; it-&amp;amp;gt;getPosition()&amp;amp;lt;&amp;amp;lt;&amp;quot;\n&amp;quot;;;&lt;br /&gt;
 &lt;br /&gt;
 	return out;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 istream&amp;amp;amp; BusSimulation::readTimeInput(istream &amp;amp;amp;in, ostream &amp;amp;amp;out)&lt;br /&gt;
 {&lt;br /&gt;
 	int minute = 0;&lt;br /&gt;
 	int hour = 0;&lt;br /&gt;
 	out&amp;amp;lt;&amp;amp;lt;&amp;quot;몇시간 후의 버스 위치를 보시겠습니까?&amp;quot;&amp;amp;lt;&amp;amp;lt;&amp;quot;\n&amp;quot;&amp;amp;lt;&amp;amp;lt;&amp;quot;시간 : &amp;quot;;&lt;br /&gt;
 	in&amp;amp;gt;&amp;amp;gt;hour;&lt;br /&gt;
 	out&amp;amp;lt;&amp;amp;lt;&amp;quot;분 : &amp;quot;;&lt;br /&gt;
 	in&amp;amp;gt;&amp;amp;gt;minute;&lt;br /&gt;
 	increaseTime(hour*3600 + minute*60);&lt;br /&gt;
 	return in;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 //Bus.h&lt;br /&gt;
 #ifndef _BUS_H_&lt;br /&gt;
 #define _BUS_H_&lt;br /&gt;
 class Bus {&lt;br /&gt;
 private:&lt;br /&gt;
 	int m_velocity; // Km/h&lt;br /&gt;
 	double m_position; // Killo meter&lt;br /&gt;
 	int m_roundDistance; // Killo meter&lt;br /&gt;
 	int m_time; // second&lt;br /&gt;
 public:&lt;br /&gt;
 	Bus(int velocity, int roundDistance) : &lt;br /&gt;
 	  m_velocity(velocity), m_roundDistance(roundDistance) {m_time=0; m_position=0;}&lt;br /&gt;
 	  void increaseTime(int time) {m_time+=time; m_position+=(time*m_velocity/3600)%m_roundDistance;}&lt;br /&gt;
 	  double getPosition(){return m_position;}&lt;br /&gt;
 };&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
= 결과 =&lt;br /&gt;
http://zerowiki.dnip.net/~namsangboy/basicBus.GIF&lt;br /&gt;
&lt;br /&gt;
= thread =&lt;br /&gt;
* 쩝.&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>imported&gt;Unknown</name></author>
	</entry>
</feed>