Hi,
Thanks for the solution...But, I have a small doubt...
But, according to this page, there is no mode as "x"...
http://www.cplusplus.com/reference/clibrary/cstdio/fopen.html
Type: Posts; User: nardneran
Hi,
Thanks for the solution...But, I have a small doubt...
But, according to this page, there is no mode as "x"...
http://www.cplusplus.com/reference/clibrary/cstdio/fopen.html
k.. It is C++...
I know that and all....
My requirement is, I want to create a file ONLY if it doesnt exist...(I dont want to append the file and all)..
Solution in any language(C or C++) is fine for me...
Sorry, for the double post....But, I posted in both since, solutions in both the languages is fine for me...
Hi,
I want to open a file ( say "test.cpp"), only if it doesnt exist in the folder that has the Program.
If it already exists, I want to quit....
I dunno how to do this...
Can...
Hi,
I want to open a file ( say "test.cpp"), only if it doesnt exist in the folder that has the Program.
If it already exists, I want to quit....
I dunno how to do this...
Can...
use the congruence
w=floor(k+floor(2.6m-0.2)-2C+y+floor(y/2)+floor(c/4))mod7
and iterate over each month.
@anon
the sample input is right...the soln is 2^(no of occurances of D+F+L+T)..so it is 4..
@maxorator
now chk my soln....
And for all that is a site dedicated for programming...its worth it..it has got the best collection of problems...from easy ones to tough graph algos...
if any body wants to try it..try these two problems....
http://www.spoj.pl/problems/KAMIL/
&
http://www.spoj.pl/problems/SIZECON/
@anon..
the c file automatically takes the variables declared as integer type...
@maxorator
the code gets complied but gives a NZEC a non zero error code...and also the output is...
ITS just code length....So whats the answer for my question...???why the 2nd soln requires "return 0;"
Cmon its not like that...its a contest question(http://spoj.pl challenge problem)...and they check the efficency of ur code length and obviously right answer too...thatsy...
and btw nobody...
let me get it straight...
This one is meant for a prg which chk the source code length...
i have 2 question...soln for 1st one was..
...
In gcc, the 'int' in main function is optional and 'return 0' is also optional...that leaves a warning but gets complied and gives output.But in one of my prg it doesnt give out put but gives error i...