הפעם נשאלת שאלה כללית יותר,
מה הסכום של כל המספרים בין L לU שמתחלקים בלפחות באחד מהמספרים בקבוצה
כתוב תוכנית קצרה שמקבלת את חמשת הפרמטרים ומחזירה את הסכום
הפתרון גלוי רק למשתמשים הכנס למערכת או הרשם בחינם
חידות לאנשים ריאלים
| עובד נהדר [sourcecode language="cpp"] for (e_1; e_2; e_3) { e_4; … e_N; } [/sourcecode] |
לא עובד, משום מה [sourcecode language="cpp"] e_1; while (e_2) { e_4; … e_N; e_3; } [/sourcecode] |
#define P(x) !( (x) & ( (x) - 1 ) )
מה המקרו עושה ?

public struct Complex
{
public int real;
public int imaginary;
public Complex(int real, int imaginary)
{
this.real = real;
this.imaginary = imaginary;
}
// Declare which operator to overload (+,*,^)
public static Complex operator +(Complex c1, Complex c2)
{
return new Complex(c1.real + c2.real, c1.imaginary + c2.imaginary);
}
public static Complex operator +(Complex c, double d)
{
return new Complex(c.real + d, c.imaginary);
}
public static Complex operator *(Complex c1, Complex c2)
{
return new Complex(c1.real * c2.real-c1.imaginary * c2.imaginary,c1.real*c2.imaginary+c2.real*c1.imaginary);
}
public static Complex operator *(Complex c, double d)
{
return new Complex(c.real *d, c.imaginary *d);
}
public static Complex operator ^(Complex c,int i)
{
Complex ret=c;
for (int j=1;j
ולא
[/solution]