- 1
- 2
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!!!!
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 );
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??????
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
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??????
/ ˙ǝɔɐds ɐɹʇxǝ ou sı ǝɹǝɥʇ puǝʇǝɹd ʇsnɾ
I have done it but I got wrong answer again this question is wrong!!!!!
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?
No. This problem doesn't have any bugs. You'r problem is sth. else.
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
In order to post something you must login first. You can use the form in the top of this page.