-
program jiafa;
vari,a,b:integer;
begini:=1;
repeat
write(i,'+');
a:=a+i;
i:=i*2;
until i=1024;
a:=a+i;
write('1024');
write('=',a);
readln
end.The above ones seem to be in C, and this is the original program written in the real Pascal language.
-
Dude, to start with 1, I'm going to use for simpler.
vari,s,k:integer;
begins:=1; k:=1;S is set to 1 because it is added from the beginning, and K is set because it is multiplied by 2
for i:=1 to 10 do because 1024 is 2 10, so to ten times.
begink:=k*2;How to calculate the power of the square.
s:=s+k;Accumulate.
end;writeln(s);
end.This is better than repeat
Until it's much simpler, with less time, less memory, easy to understand, and easy to write.
-
int x;
for(int i=1;i<=10;i++)x += ,i)
The value of the last x is what is sought.
-
int i = 1;
int result=0;
doresult += i;
i = i * 2;
while (result < 1024);
I don't know what program you're using.,Anyway, it's more common to write it like this.,Finally, you can pull the result output.。
-
The details are as follows:Using the formula: sn=a1(1-q n) (1-q) =(a1-an q) (1-q) (q≠1) So:
Additive calculations:Combining two or more numbers and quantities into one number or quantity. The symbol for addition is the plus sign "+", and when adding, the items are connected with a plus sign.
Addition has several important properties. It is commutative, which means that the order is not important, and it is again interrelated, which means that when more than two numbers are added, the order in which the addition is performed does not matter. Repeat plus 1 is the same as counting; Adding 0 does not change the result.
Addition also follows the relevant actions.
-
This is the sum of proportional sequences. The formula is sn=a1(1-q n) (1-q) =(a1-an q) (1-q) (q≠1) and the solution is sn=(1-1024 2) (1-2)=2047
-
Original = 1 1024 + 2 1024 + 4 1024 ++512 Zheng Manuscript 1024 + 1024 Zhaoliang 1024+1024^2/1024
2^0+2^1+2^2+.+2 20) Shout Guess Filial Piety 1024
-
Xiao Ming has x apples. Xiao Fang is more than three times that of Xiao Ming, 5 for 125, and asked how many Xiao Ming had.
-
3 boys and a girl get 125 apples, girls get 5, ask how many for each boy?
Faced with the problems of life, Li Bai also once "had to be happy in life", but finally had an epiphany, and wrote the sentence "Straight to the clouds and sails to the sea". Su Shi, who is "a lonely grave for thousands of miles, with nowhere to talk about desolation", gained valuable sobriety in the process of solving the problem. On the way to Dengzhou, Fan Zhongyan looked down on the impermanence of the world and the ups and downs of the sea, and solved the problems of life with the mind of "not happy with things, not sad with yourself". >>>More
Mango (1) = 15 3 = 5
Banana (1) = (13-5) (3+3) = 1 papaya (half) = (8+4) 2=6 >>>More
Impossible. Coloring this diagram at intervals like a chess board, with a total of 5 5 = 25 squares, assuming that the upper left corner is a black square, then it is easy to see that there are 13 black, 12 white, and the triangle is white. Then the circle has 13 blacks and 11 whites. >>>More
Solution: Suppose you answered x questions correctly.
3x+(30-x)=78 >>>More
Let's say there are a total of x balls in the bag.
The starting red ball accounts for 1 4, then the starting red ball has 1 4*x. >>>More