|
|
back to boardStrange problem! (for those who has wa 1) 1) For those who get WA 1 mb helps : with while (!cin.eof()) char c = cin.get(); i had WA 1 with char t[10000]; cin.getline(t, 1000); i had WA 9 ! 2) the problem says that the length of input is no more than 10000 characters but this code ... char t[10000]; cin.getline(t, 10000) ... get WA9 this : char t[20000]; cin.getline(t, 20000); get AC Strange, isn't it? Re: Strange problem! (for those who has wa 1) Yes,It's very strange! ----------- char t[10001]; cin.getline(t,10000,'\n'); ---------- I got WA9. ----------- char t[10001]; cin.getline(t,10001,'\n'); ---------- I got AC! Re: Strange problem! (for those who has wa 1) 1. Maybe you didn't add a '\0' at the end of string when reading by chars. 2. For maxlen=10000, array must be at least as big as 10001! |
|
|