Search found 141 matches

by lnr
Fri Oct 17, 2008 8:01 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 29726

Re: 401 palindromes WA help

To pushpit.saxena

Try these.
input:

Code: Select all

ISSEJML11JML322I
SV2OSV2
8SZSJYYL2528
output:

Code: Select all

ISSEJML11JML322I -- is a mirrored string.

SV2OSV2 -- is a mirrored string.

8SZSJYYL2528 -- is a mirrored string.
by lnr
Fri Oct 17, 2008 7:48 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 29726

Re: 401- Palindromes WA. I'm going crazy

To Obaida
Problem says:
In addition, after each output line, you must print an empty line.
May be you are not printing an extra blank line.
See the output format of this problem.
There are other threads for this problem.
See those also to be sure about the output format.
by lnr
Fri Oct 17, 2008 7:39 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 29726

Re: 401 palindromes WA help

To samin.
Problem says:
In addition, after each output line, you must print an empty line.
May be you are not printing the blank line.
See the output format in this post above and in the problem.
Compare the format with yours.
by lnr
Fri Oct 10, 2008 12:13 pm
Forum: Volume 113 (11300-11399)
Topic: 11367 - Full Tank?
Replies: 13
Views: 7790

Re: 11367 - Full tank?

Would someone give hint ?
by lnr
Thu Oct 09, 2008 1:15 pm
Forum: Volume 4 (400-499)
Topic: 489 - Hangman Judge
Replies: 52
Views: 13750

Re: confuse 489 with online judge

Hi linux.

Input:

Code: Select all

1
cheese
ch
-1
Output:

Code: Select all

Round 1
You chickened out.
by lnr
Thu Oct 09, 2008 1:05 pm
Forum: C++
Topic: Problems with random numbers
Replies: 4
Views: 2576

Re: Problems with random numbers

Without "cstdlib" rand()/static_cast<double>(RAND_MAX) works. In spite of using "cstdlib" Microsoft Visual C++ 2008 does not support drand48(). #include<iostream> #include<cstdlib> using namespace std; int main() { //cout<<rand()/static_cast<double>(RAND_MAX)<<endl; cout<<drand48()<<endl; return 0; }
by lnr
Thu Oct 09, 2008 4:17 am
Forum: C++
Topic: Problems with random numbers
Replies: 4
Views: 2576

Re: Problems with random numbers

Thanks mf.
But drand48() gets compile time error.
by lnr
Wed Oct 08, 2008 8:40 pm
Forum: C++
Topic: Problems with random numbers
Replies: 4
Views: 2576

Problems with random numbers

Can someone please tell me how to generate random numbers between 0 to 1?
by lnr
Wed Oct 08, 2008 7:17 am
Forum: Volume 113 (11300-11399)
Topic: 11398 - The Base-1 Number System
Replies: 23
Views: 9357

Re: 11398 - The Base-1 Number System

To x140l31 Submit your code again. I did not know that GNU C++ compiler supports and operator. while (cin >> block and block != "~") is similar to while (cin >> block && block != "~") Returning a value from int main() is a good practice. You will get accepted. May be you submitted wrong code before....
by lnr
Wed Oct 08, 2008 6:43 am
Forum: Volume 100 (10000-10099)
Topic: 10098 - Generating Fast
Replies: 62
Views: 13512

Re: Efficient Java IO..Please Help

To GUC.HassanMohamed

Taking input seems alright to me.
May be taking input in java is slower than C or C++.
by lnr
Wed Oct 08, 2008 6:35 am
Forum: Volume 113 (11300-11399)
Topic: 11398 - The Base-1 Number System
Replies: 23
Views: 9357

Re: 11398 - The Base-1 Number System

I am very sorry.

Input:

Code: Select all

000 00 0 00 000 #
~
Output:

Code: Select all

0
I updated the output.
by lnr
Wed Oct 08, 2008 5:45 am
Forum: C
Topic: Bsearch---built in
Replies: 4
Views: 4554

Re: Bsearch---built in

I am very sorry.
Yes you are absolutely right.
by lnr
Tue Oct 07, 2008 5:32 pm
Forum: C
Topic: Bsearch---built in
Replies: 4
Views: 4554

Re: Bsearch---built in

To nikhil

Code: Select all

binary_search() from STL.
by lnr
Tue Oct 07, 2008 5:17 pm
Forum: C
Topic: Needing a little help - Problem with Files
Replies: 2
Views: 4018

Re: Needing a little help - Problem with Files

To leoisl EOF is always at the last. If the (m.txt )file content is like this 4 6 7 567 3 3 5 7 7 8 3 5 Running this code: #include <iostream> #include <string> using namespace std; int main() { freopen("m.txt","r",stdin); char ch; int i,c; c=0; while(cin>>i) { ++c; cout<<i<<' '; if(c%20==0) cout<<e...
by lnr
Tue Oct 07, 2008 5:02 pm
Forum: C
Topic: Files and Folder
Replies: 1
Views: 4392

Re: Files and Folder

To emotional blind

To delete a file

Code: Select all

remove("filename.txt");
To rename a file

Code: Select all

rename("oldname.txt","newname.txt");
To create a file

Code: Select all

FILE *fp=fopen("filename.txt","r");
To copy a file
http://www.google.com/search?hl=en&q=ho ... tnG=Search

Thanks all.

Go to advanced search