<?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=%EC%BD%94%EB%93%9C%EB%A0%88%EC%9D%B4%EC%8A%A4%2F2007.03.24%EC%A0%95%ED%98%84%EC%98%81%EB%8F%99%EC%9B%90%ED%9D%AC</id>
	<title>코드레이스/2007.03.24정현영동원희 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=%EC%BD%94%EB%93%9C%EB%A0%88%EC%9D%B4%EC%8A%A4%2F2007.03.24%EC%A0%95%ED%98%84%EC%98%81%EB%8F%99%EC%9B%90%ED%9D%AC"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=%EC%BD%94%EB%93%9C%EB%A0%88%EC%9D%B4%EC%8A%A4/2007.03.24%EC%A0%95%ED%98%84%EC%98%81%EB%8F%99%EC%9B%90%ED%9D%AC&amp;action=history"/>
	<updated>2026-05-15T17:27:55Z</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=%EC%BD%94%EB%93%9C%EB%A0%88%EC%9D%B4%EC%8A%A4/2007.03.24%EC%A0%95%ED%98%84%EC%98%81%EB%8F%99%EC%9B%90%ED%9D%AC&amp;diff=76261&amp;oldid=prev</id>
		<title>imported&gt;Unknown at 05:31, 7 February 2021</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=%EC%BD%94%EB%93%9C%EB%A0%88%EC%9D%B4%EC%8A%A4/2007.03.24%EC%A0%95%ED%98%84%EC%98%81%EB%8F%99%EC%9B%90%ED%9D%AC&amp;diff=76261&amp;oldid=prev"/>
		<updated>2021-02-07T05:31:19Z</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;Signal.java&lt;br /&gt;
 &lt;br /&gt;
 public class Signal {&lt;br /&gt;
 	int firstTime, secondTime, thirdTime;&lt;br /&gt;
 	String color, color2, color3;&lt;br /&gt;
 	private Time[] times;&lt;br /&gt;
 	public Signal(int firstTime, String color, int secondTime, String color2, int thirdTime, String color3) {&lt;br /&gt;
 		this.color= color;&lt;br /&gt;
 		this.firstTime= firstTime;&lt;br /&gt;
 		this.secondTime= secondTime;&lt;br /&gt;
 		this.color2= color2;&lt;br /&gt;
 		this.thirdTime= thirdTime;&lt;br /&gt;
 		this.color3= color3;&lt;br /&gt;
 	}&lt;br /&gt;
 	public String getColor(int time) {&lt;br /&gt;
 		int adjustedTime= time%(firstTime+ secondTime + thirdTime);&lt;br /&gt;
 		if(adjustedTime &amp;amp;lt; firstTime) &lt;br /&gt;
 			return color;&lt;br /&gt;
 		else if (adjustedTime&amp;amp;lt;firstTime+secondTime)&lt;br /&gt;
 			return color2;&lt;br /&gt;
 		else return color3;&lt;br /&gt;
 	}&lt;br /&gt;
 	&lt;br /&gt;
 	public String getColorWithDate(int year, int month, int day, int hour, int minute, int second)&lt;br /&gt;
 	{&lt;br /&gt;
 		int totalSecond=((((365*(year-2000)+(month-1)*30+(day-1)*24+hour)*60)+minute)*60+second);&lt;br /&gt;
 		return getColor(totalSecond);&lt;br /&gt;
 	}&lt;br /&gt;
 	&lt;br /&gt;
 	public void insertCrosser(Time[] times ) {&lt;br /&gt;
 		this.times= times;&lt;br /&gt;
 	}&lt;br /&gt;
 	public int checkViolation()&lt;br /&gt;
 	{&lt;br /&gt;
 		int number= 0;&lt;br /&gt;
 		for (Time time : times) {&lt;br /&gt;
 			if(getColorWithDate(time).equals(&amp;quot;Red&amp;quot;)) {&lt;br /&gt;
 				number++;&lt;br /&gt;
 			}&lt;br /&gt;
 		}&lt;br /&gt;
 		return number;&lt;br /&gt;
 	}&lt;br /&gt;
 	private String getColorWithDate(Time time) {&lt;br /&gt;
 		return getColorWithDate(time.year, time.month, time.day, time.hour, time.minute, time.second);&lt;br /&gt;
 	}&lt;br /&gt;
 	&lt;br /&gt;
 	&lt;br /&gt;
 	public static void main(String []args)&lt;br /&gt;
 	{&lt;br /&gt;
 		Signal signal= new Signal(120, &amp;quot;Red&amp;quot;, 5, &amp;quot;Yellow&amp;quot;, 30, &amp;quot;Green&amp;quot;);&lt;br /&gt;
 		System.out.println(signal.getColor(30));&lt;br /&gt;
 		System.out.println(signal.getColor(120));&lt;br /&gt;
 		System.out.println(signal.getColorWithDate(2007, 3, 24, 12, 30, 24));&lt;br /&gt;
 		System.out.println(signal.getColorWithDate(2000, 1, 1, 0, 0, 0));&lt;br /&gt;
 		&lt;br /&gt;
 		Time[] times2= new Time[3];&lt;br /&gt;
 		times2[0]= new Time(2004, 2, 3, 11, 25, 16);&lt;br /&gt;
 		times2[1]= new Time(2002, 7, 21, 5, 3, 55 );&lt;br /&gt;
 		times2[2]= new Time(2012, 1, 1, 0, 0, 1);&lt;br /&gt;
 		&lt;br /&gt;
 		signal.insertCrosser(times2);&lt;br /&gt;
 		System.out.println(signal.checkViolation());&lt;br /&gt;
 	}&lt;br /&gt;
 	&lt;br /&gt;
 	&lt;br /&gt;
 }&lt;br /&gt;
Time.java&lt;br /&gt;
 &lt;br /&gt;
 public class Time{&lt;br /&gt;
 	public int year;&lt;br /&gt;
 	public int month;&lt;br /&gt;
 	public  int day;&lt;br /&gt;
 	public  int minute;&lt;br /&gt;
 	public  int hour;&lt;br /&gt;
 	public  int second;&lt;br /&gt;
 	public Time() {&lt;br /&gt;
 		&lt;br /&gt;
 	}&lt;br /&gt;
 	public Time(int year, int month, int day, int hour, int minute, int second ) {&lt;br /&gt;
 		this.year= year;&lt;br /&gt;
 		this.month= month;&lt;br /&gt;
 		this.day= day;&lt;br /&gt;
 		this.hour= hour;&lt;br /&gt;
 		this.minute= minute;&lt;br /&gt;
 		this.second= second;&lt;br /&gt;
 	}&lt;br /&gt;
 	&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>imported&gt;Unknown</name></author>
	</entry>
</feed>