pages:
  • 1
  • 2
Danial SAYS

I think the input of this question is wrong because in the sceond line The Alderaan has whitespace after it and in the output there is just one whitespace and that is wrong it has to be two!!!!

Daneshvar Amrollahi SAYS

Danial said:

I think the input of this question is wrong because in the sceond line The Alderaan has whitespace after it and in the output there is just one whitespace and that is wrong it has to be two!!!!

You should consider only one space after the name --> This syntax: name1 to name2: number

I submitted this with one space and I got accepted.

            write(s1,' to ',s2,': ');
            writeln( sqrt(pow2(x2-x1)+pow2(y2-y1)+pow2(z2-z1)):0:2 );
Danial SAYS

I wrote with this syntax but in C++ but I got wrong answer each word have extra whitespace and when I print it with that syntax there is extra whitespace in output so here is the problem why after each input there is extra whitespace and it is'nt in output??????

Daneshvar Amrollahi SAYS

Are you writing the answer with digits after the point? (two digits of precision to the right of the decimal) If you are getting wrong answer, I think it's because of this. If there is problem in number of spaces, you should receive presentation error(not wrong answer)

In c++ you can control the number of digits right to the decimal by this;

#include<iomanip>
float a = 1.8931;
cout<<fixed<<setprecision(2)<<a<<endl; //prints 1.89 while a equals to 1.8931
Danial SAYS

First:No presentation error just happend when you have extar whiteline or more than one its not for whitespace Second:I know about setprecision but I don't use cout I use printf because it's faster than cout and can write decmial easy than cout like that printf("%.2f",n); but I have another question why after each input there is extra whitespace and it is'nt in output??????

BECCA SAYS

/ ˙ǝɔɐds ɐɹʇxǝ ou sı ǝɹǝɥʇ puǝʇǝɹd ʇsnɾ

Danial SAYS

I have done it but I got wrong answer again this question is wrong!!!!!

Daneshvar Amrollahi SAYS

Maybe it's a bug of the judge. Report it to Amir Sabouri from the left bar (Report a bug) Ask him about the whitespace. He should answer Try to search this problem on Google. Maybe it's an ACM problem so you can see the original problem. Do you want the Pascal code?

BECCA SAYS

No. This problem doesn't have any bugs. You'r problem is sth. else.

Danial SAYS

Of Course there is problem!Why there is extra whitespace in input and it is not in output so it's buge without any doubt