-
Notifications
You must be signed in to change notification settings - Fork 2
/
infoark_trd.html
185 lines (174 loc) · 6.71 KB
/
infoark_trd.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="no" lang="no">
<head>
<title>Norgesmesterskap i programmering 2004, NTNU Trondheim</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords"
content="acm,collegiate,student,programming,contest,norway,norge,
programmering,konkurranse,trondheim,norgesmesterskap,ntnu,
idi,competition,tasks" />
<meta name="description"
content="Norgesmesterskap i programmering, NTNU Trondheim, Norway -
local ACM Collegiate Programming Contest, competition for
teams of students in solving programming tasks." />
<style type="text/css">
body {
color: black;
background-color: #ffffff;
}
h2 {
margin-top: 40px;
}
pre {
background-color: #dddddd;
}
</style>
</head>
<body>
<h1>Infoark for NCPC 2005 i Trondheim</h1>
<p>
Denne info finnes på
<a href="http://ncpc.idi.ntnu.no/ncpc2005/infoark_trd.html">http://ncpc.idi.ntnu.no/ncpc2005/infoark_trd.html</a>.
</p>
<p>
Hvis noen savner info på denne siden, send gjerne en mail til
<a href="mailto:[email protected]">[email protected]</a>.
</p>
<h2>Lovlige ressurser</h2>
<ul>
<li>Alt skriftlig materiale.</li>
<li><a href="http://java.sun.com/j2se/1.5.0/docs/api/index.html">Java 1.5.0 API</a></li>
<li><a href="http://www.sgi.com/tech/stl/table_of_contents.html">C++ STL</a> (SGI)</li>
<li>MSVS <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcstdlib/html/vcoriStandardCLibraryReference.asp">Standard C++ Library Reference</a></li>
<ul>
<li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcstdlib/html/vclrfcpluspluslibraryoverview.asp">Standard C++ Library Overview</a></li>
<li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_run.2d.time_routines_by_category.asp">Run-Time Routines by Category</a></li>
<li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/vclrfalphabeticalfunctionreference.asp">Alphabetical Function Reference</a></li>
<li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_global_constants.asp">Global Constants</a></li>
</ul>
<li>Ingen andre elektroniske ressurser</li>
</ul>
<h2>Teknisk info</h2>
<p style="color: red;">
Følgende info er utdatert, men vil bli oppdatert etter hvert.
</p>
<h3>Innlogging</h3>
<ul>
<li>Innlogging: Bruker/passord mottatt ved innsjekking.
Domene IDIPC.</li>
<li>Brukerområde: <code>Z:</code></li>
<li>Starte PC^2: <code>Z:\PC2\pc2team.bat</code></li>
<li>Pålogging PC2: teamN/teamN (for passende verdier av N)</li>
</ul>
<h3>Textpad</h3>
<ul>
<li>Starte Textpad: Start -> All Programs -> Textpad</li>
<li>Fikse '}': Configure -> Preferences -> Keyboard. Fjern ALT-0
fra View + ActiveClipLib.</li>
</ul>
<h3>Emacs</h3>
<ul>
<li>Starte Emacs: Start -> All Programs -> GNU Emacs -> .
(Problemer med { og }: Kan lages med <code>CTRL-ALT-7</code>
og <code>CTRL-ALT-0</code>).</li>
</ul>
<h3>VI</h3>
<ul>
<li>Kan lastes ned fra <a href="http://www.vim.org/download.php#pc">www.vim.org</a> og installeres på
<code>Z:</code>, hvis du heller vil bruke dette enn Emacs og
Textpad.</li>
</ul>
<h3>Kjøring fra kommandolinjen</h3>
<ul>
<li>Java kommandolinje: Start -> Run -> Cmd,
<code>javac Klasse.java</code>,
<code>java Klasse < innput.txt</code></li>
<li>C/C++ kommandolinje: Start -> All programs ->
Microsoft Visual Studio .NET 2003 -> Visual Studio .NET Tools ->
Visual Studio .NET Command Prompt, <code>cl /EHsc foo.c</code>,
<code>foo.exe < innput.txt</code></li>
</ul>
<h3>Visual Studio programmeringsmiljø</h3>
<ul>
<li>Visual Studio programmeringsmiljø: Start -> All programs ->
Microsoft Visual Studio .NET 2003 ->
Microsoft Visual Studio .NET 2003</li>
</ul>
<h3>Utskrift</h3>
<p>
Du kan skrive ut programmene dine på skriveren \\printhost\p336 hvis du vil
debugge på papir. Be en dommer hente utskriften.
</p>
<h3>Toalett</h3>
<p>
Finnes innerst i gangen.
</p>
<h2>Test</h2>
<p>
Du kan teste at det tekniske oppsettet fungerer på følgende måte:
</p>
<ul>
<li>Lag katalogen Z:\test</li>
<li>Lagre Test.java, test.c, test.cpp og test.in på Z:\test (listet under)</li>
<li>Start C/C++ kommandolinjeskall (se over)</li>
<li><code>Z:</code></li>
<li><code>cd \test</code></li>
<li><code>javac Test.java</code></li>
<li><code>java Test < test.in</code></li>
<li><code>cl test.c</code></li>
<li><code>test.exe < test.in</code></li>
<li><code>cl /EHsc test.cpp</code></li>
<li><code>test.exe < test.in</code></li>
</ul>
<p>
Disse programmene skal skrive ut: <code>5.86</code>.
</p>
<p>Test.java</p>
<pre>
import java.io.*;
import java.text.*;
import java.util.*;
public class Test {
static DecimalFormat DF =
new DecimalFormat("0.00", new DecimalFormatSymbols(Locale.ENGLISH));
public static void main(String[] args) throws Exception {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(bf.readLine());
double a = Double.parseDouble(st.nextToken());
double b = Double.parseDouble(st.nextToken());
System.out.println(DF.format(a + b));
}
}</pre>
<p>test.c</p>
<pre>
#include <stdio.h>
int main()
{
double a, b;
scanf("%lf %lf", &a, &b);
printf("%.2lf\n", a + b);
}</pre>
<p>test.cpp</p>
<pre>
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double a, b;
cin >> a >> b;
cout << setiosflags(ios::fixed)
<< setprecision(2)
<< a + b
<< endl;
}</pre>
<p>test.in</p>
<pre>
2.71828182846 3.14159265359</pre>
<!-- END CONTENT -->
</td>
</tr>
</table>
</body>
</html>