Type: Posts; User: AmadeusAD
Search took 0.01 seconds.
April 16th, 2009, 07:54 AM
What exactly do you implement? Modular arithmetic covers a lot... Anything, somehow related to remainders and integer division...
The signature (x op y) (mod N) means, in terms of C++, that ((x % N)...
April 14th, 2009, 08:55 AM
Just a few tips:
1) You have to use properly adjusted console to display Chinese. I.e., the corresponding fonts must be installed and displayed codepage should be also correct.
2) You have to...
April 14th, 2009, 08:47 AM
Furthermore, you can replace ++i in both loops with i+=2 with some slight check adding outside the loop.
April 14th, 2009, 05:44 AM
Not surprisingly that no numbers are displayed. Look at your condition - it is always false since i%n cannot be both i and 1 at the same time. Why do you still code that annoying i%n==1 check? What...
April 14th, 2009, 05:02 AM
Hooooppssss... Just at a glance - this is not your code and it is, by the way, ill-formed C++ style mixed with C... All those questions you ask can, I suppose, find their answers in the low-level...
April 14th, 2009, 04:40 AM
Again, i % n == 1 is a check whether i is divided by n with remainder 1. That is not probably what you want. If you want to check whether i has a divider different from i and 1, then you should (in...
April 13th, 2009, 01:17 PM
In my original working code, I have the vector resized after reserve(), so all the elements before push_back() exist.
About small compilable program - you know, I reproduced the same (I think so)...
April 13th, 2009, 12:23 PM
You have also ill-formed logic for your task. Consider, that % operator returns the remainder, not the bool value 'divisable'. For determining whether i is divided by j, you have to determine whether...
April 13th, 2009, 11:35 AM
I have been persuaded for a long time that stl containers are the better choice compared to any home-cooked alternatives, partially, because experienced that in my own practice.
April 9th, 2009, 06:26 AM
Why don't you try to experiment yourself writing something like
char t = '10'; // compiler probably will warn you, but compilation will not fail
April 9th, 2009, 06:14 AM
And, by the way, your conditions will always be false due to incorrect usage of logical operation 'AND' (&&). You should use 'OR' (||) instead, since word[START] cannot be both, for instance, 'A' and...
April 9th, 2009, 06:01 AM
int i =3;
if (word[START] == 'a' && word[START] == 'e' && word[START] == 'i'
&& word[START] == 'o' && word[START] == 'u')
int i = 1;
else if(word [START] =='q' && word[START + 1] == 'u')
April 8th, 2009, 07:27 AM
Maybe, your static library is compiled without _DEBUG defined? Try to recompile all the stuff of your project making sure _DEBUG is defined for each file. You can reach this by doing -D_DEBUG command...
April 2nd, 2009, 08:21 AM
You cannot overload function just adding one or more 'const' specifiers anywhere.
You can use just one int& f1() for both purposes I believe.
March 26th, 2009, 01:37 PM
I suppose scanf format string is not intended to be used as a regular expression, while in your example you do mix original format string specifiers with regexp literals. Are you sure "[^ ]" would...
March 10th, 2009, 11:58 AM
Discovered the above message after posting my one and page refresh:).
March 10th, 2009, 11:56 AM
endl declared inside std namespace. So, you should write
using namespace std;
March 10th, 2009, 11:47 AM
Also you may use switch to avoid multiplying the if-else tree (that is probably significant for a large number of various discrete variants):
// ... do...
March 4th, 2009, 08:27 AM
Oh, yeah, I saw this approach somewhere - good tricks for C-lovers:) and in general - useful for those who want to understand language constructs better.
But you see, that's a kind of tricking,...
March 4th, 2009, 06:21 AM
At a first glance the following code runs into eyes:
The arguments to scanf() functions that follow the format string specification are addresses of the vars where the input should be stored. In...
March 4th, 2009, 06:14 AM
The idea probably is the same, just use appropriate string conversion function and/or format specifications, which recognizes hexadecimal letter-digits. No more info can be provided until you show us...
March 4th, 2009, 06:08 AM
Lindley gave complete answer. I'll just focus on conceptual difference - it's based upon the difference between those two languages. C and C++ are structural and object-oriented ones respectively....
March 3rd, 2009, 12:05 PM
That was Russian, you are right:)
The question asks whether one can post in Russian on this forum. Nevermind;)
March 3rd, 2009, 12:01 PM
Sorry, I posted that occasionally, just for fun:)
Actually, I like the process of spending hours solving a problem too, that brings a lot to one's qualification. And was trying to construct...
March 3rd, 2009, 11:42 AM
А на этом форуме пишут по-русски?)
Click Here to Expand Forum to Full Width