ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Форумы > Обсуждение задач > тема:


Задача "Question 2"

Идёт турнир!

В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания.

Страницы:  [1]  (2)

imesecan20.окт.2012 в 10:55:31
0Сообщение скрыто

imesecan20.окт.2012 в 11:03:34
1Your program gives error on the first test. I checked your output and the pattern. The pattern seems correct.

Please check your program again.

imesecan20.окт.2012 в 11:38:29
2Сообщение скрыто

imesecan20.окт.2012 в 11:46:26
3It's OK to add or not? There is no difference. The checker reads as integer, and thus, space is ignored.

imesecan20.окт.2012 в 12:29:27
4Сообщение скрыто

imesecan20.окт.2012 в 12:37:39
5The test inputs are like the sample inputs from the question.

imesecan20.окт.2012 в 13:25:42
6Сообщение скрыто

imesecan20.окт.2012 в 14:12:17
7Сообщение скрыто

imesecan20.окт.2012 в 15:28:04
8Сообщение скрыто

imesecan20.окт.2012 в 15:30:46
9OK. Let me give the test case 1:
Test input1:
<p>For a research on languages, scientiests want to see which letters are used most. In order to make these letters calculations, write a program in which the user
can write a text and the program shows the frequency of letters.</p>

<p><strong>Input specification</strong><br />
The input text can contain any character. You required to read until the end of file.</p>


The output is:
A= 22
B= 1
C= 14
D= 6
E= 38
F= 6
G= 6
H= 13
I= 18
J= 0
K= 1
L= 8
M= 4
N= 21
O= 18
P= 9
Q= 2
R= 25
S= 19
T= 34
U= 10
V= 0
W= 6
X= 2
Y= 3
Z= 0

imesecan20.окт.2012 в 15:36:06
10Сообщение скрыто

imesecan20.окт.2012 в 16:00:24
11Сообщение скрыто

imesecan20.окт.2012 в 16:34:41
12Сообщение скрыто

imesecan20.окт.2012 в 17:20:52
13
(12: devidduma)
in C++ when you say,
while(fin>>c) (in C you have similar structures)
that reads the the chars until the end of file.

imesecan20.окт.2012 в 17:25:34
14Сообщение скрыто

imesecan20.окт.2012 в 17:29:42
15Сообщение скрыто

imesecan20.окт.2012 в 17:45:15
16Сообщение скрыто

imesecan20.окт.2012 в 17:51:19
17Сообщение скрыто

imesecan20.окт.2012 в 18:11:55
18
(16: devidduma)
Yes, this ( while(fin>>c) ) is actually for reading an input from a file. As you said, the standard reading ( while(cin>>c) ) works here because the standard input and output are directed to files.

As you proposed, the question could be much understandable for standard input, if we have mentioned sth special that can be used to show the end of file (like the one ";" we have used in question four).

But you, are Olympiad students, you must be comfortable with reading from text files.

imesecan20.окт.2012 в 18:27:26
19
(17: evis)
Your problem I think you are not comfortable with files. You use standard input
while(getline(cin,t))
{
if (t.empty())
....

But, in the test input there was a line which contains nothing (an empty line). Thus, your code finishes reading there :(

As mentioned in the question you should have read until the end of file.


Страницы:  [1]  (2)

www.contester.ru