WEBVTT 00:00.360 --> 00:02.170 The problem is to summon numbers. 00:02.220 --> 00:04.980 And N is given by the user. 00:05.730 --> 00:09.200 In order to make the analysis we need to have a given number n. 00:09.540 --> 00:11.560 So n is equal to. 00:11.580 --> 00:17.270 Then again I am suggesting composing the video and trying to find the solution by yourself. 00:17.520 --> 00:19.830 Let's try to calculate this with a for loop. 00:19.920 --> 00:22.290 The idea here is to use a variable A. 00:22.560 --> 00:24.540 That will save our current value. 00:24.540 --> 00:27.760 Of course they will start with zero in dividend. 00:27.780 --> 00:29.450 We wee lad the next number. 00:29.490 --> 00:33.470 So a plus one a blast tool. 00:33.960 --> 00:35.420 And so on. 00:35.610 --> 00:38.520 So we can write A is equal to A plus 1. 00:38.580 --> 00:40.890 A is equal to AA plus two. 00:41.010 --> 00:45.310 In this way we will first have a sequel to zero plus one. 00:45.810 --> 00:53.460 Then A is equal to one class to end A is equal to a city plus 3. 00:53.490 --> 00:57.500 I believe that this will work but it was able to write in command lines. 00:57.570 --> 01:00.600 What if the user wanted to add ten thousand numbers. 01:00.840 --> 01:03.690 You'll need to write the thousand times the same thing. 01:03.690 --> 01:05.140 Here comes handy. 01:05.210 --> 01:05.580 The. 01:05.610 --> 01:12.330 Of the four rule you can create the law for x in it ain't. 01:15.610 --> 01:17.740 1 Cor 11. 01:17.860 --> 01:25.090 In this way you will have it x ranging from one to all all the way to 10. 01:25.300 --> 01:30.670 Of course inside the following You can write a sequel to a plot specs. 01:30.760 --> 01:37.720 In this way you will create that 10 command lines that in the previous program will have to write them 01:37.720 --> 01:41.640 down in the first loop x equal to 1. 01:41.860 --> 01:44.710 So you will have a equal weight plus one. 01:45.160 --> 01:48.190 Then you will have X quoted tool. 01:48.490 --> 01:51.520 So a equal to A plus 2. 01:53.060 --> 01:55.030 And so on that sort of thing you. 01:55.550 --> 02:01.740 Let's try to create that actual program first and do have a number from the user So an issue quote or 02:01.820 --> 02:03.250 input. 02:04.740 --> 02:10.870 How many numbers then rebuilt does form this number in integer. 02:10.950 --> 02:15.530 Because right now n is a character so an issue of two into two. 02:15.570 --> 02:22.790 And then we should initialize that a quote the zede or as we already analyze in theory. 02:22.980 --> 02:29.870 Now for x in A and one com Mark N.. 02:29.890 --> 02:36.500 Last one here we had 8 and plus 1 because the 4 looks subtract 1 from the Enter number. 02:36.750 --> 02:38.410 Then we will write a sequel. 02:38.430 --> 02:44.180 A plus X as we already did in theory and we will print this out. 02:44.350 --> 02:50.340 Okay let's try with 10 in the this 55 which is correct.