1
00:00:00,000 --> 00:00:00,340

2
00:00:00,340 --> 00:00:02,690
>> DAVID Malan: Tuseme tunatarajia kuandika
mpango kwamba humshauri mtumiaji

3
00:00:02,690 --> 00:00:05,100
kwa kamba na kisha herufi
kwamba kamba.

4
00:00:05,100 --> 00:00:09,000
Naam, hebu kuanza na baadhi ukoo
code kutangaza string kuitwa s na

5
00:00:09,000 --> 00:00:11,380
kumshirikisha ni kurudi
thamani ya GetString.

6
00:00:11,380 --> 00:00:14,910
Na hebu sasa kuendelea na iterate juu ya
wahusika katika kamba hii.

7
00:00:14,910 --> 00:00:16,000
Naam, jinsi ya kufanya hivyo?

8
00:00:16,000 --> 00:00:19,350
Ni zinageuka kuwa string ni
mlolongo wa wahusika, lakini zaidi

9
00:00:19,350 --> 00:00:23,320
vizuri, kamba ni safu ya
wahusika, ambayo ina maana tunaweza kutumia

10
00:00:23,320 --> 00:00:27,590
Mabano ya mraba nukuu kwa index katika
kamba na kupata mtu binafsi

11
00:00:27,590 --> 00:00:28,680
wahusika.

12
00:00:28,680 --> 00:00:30,980
>> Kwa maneno mengine, tunaweza
kufanya yafuatayo.

13
00:00:30,980 --> 00:00:36,730
Kwa int, i anapata 0, na n anapata,
kusema, urefu wa s, kwa kutumia

14
00:00:36,730 --> 00:00:37,530
kazi yetu [? kuchochea?]

15
00:00:37,530 --> 00:00:38,630
[? line,?]

16
00:00:38,630 --> 00:00:40,450
i ni chini ya n i + +.

17
00:00:40,450 --> 00:00:45,290
Kwa maneno mengine, kwa kitanzi hii, sisi
itakuwa iterate juu ya barua zote n

18
00:00:45,290 --> 00:00:46,670
katika kamba s.

19
00:00:46,670 --> 00:00:51,680
Na ndani ya kitanzi hii, mimi nina kwenda
kuangalia, kama i-th tabia katika s

20
00:00:51,680 --> 00:00:57,630
zaidi au sawa na Herufi za chini,
na i-th tabia ni chini ya au

21
00:00:57,630 --> 00:01:02,370
sawa na c lowercase, basi nataka
kuendelea na herufi hiyo.

22
00:01:02,370 --> 00:01:08,030
Kwa maneno mengine, nataka magazeti nje% c
kama placeholder na mbadala kwa ajili ya

23
00:01:08,030 --> 00:01:11,120
kwamba placeholder s bracket i.

24
00:01:11,120 --> 00:01:14,390
>> Lakini basi mimi haja ya kubadili
s bracket i kwa uppercase.

25
00:01:14,390 --> 00:01:18,930
Kwa kufanya hivyo, siwezi tu Ondoa
chochote tofauti ni kati ya

26
00:01:18,930 --> 00:01:24,120
lowercase a na mji mkuu wa A. Naam, mimi
kwa kweli kufanya kukumbuka kwamba mji mkuu wa A ni

27
00:01:24,120 --> 00:01:27,160
65 katika ASCII, na ndogo a ni 97.

28
00:01:27,160 --> 00:01:29,210
Hivyo tofauti ni kitaalam 32.

29
00:01:29,210 --> 00:01:31,620
Hivyo mimi naweza tu code ngumu 32 hapa.

30
00:01:31,620 --> 00:01:33,870
Lakini mimi ili si lazima
kukumbuka namba hizo.

31
00:01:33,870 --> 00:01:37,250
>> Na zaidi ya hayo, nini kama
kutofautiana na kompyuta?

32
00:01:37,250 --> 00:01:38,520
Zaidi uwezekano wa wao siyo.

33
00:01:38,520 --> 00:01:42,460
Lakini jambo unabakia kuwa mimi bado unaweza
kujumlisha maneno hayo hesabu

34
00:01:42,460 --> 00:01:46,550
kama tu chochote tofauti ni
kati ya lowercase a na mji mkuu wa A

35
00:01:46,550 --> 00:01:50,880
ni nini nataka Ondoa mbali na
hasa hii lowercase barua.

36
00:01:50,880 --> 00:01:54,500
>> Sasa, kama barua hii hasa
si Herufi za chini, mimi tu

37
00:01:54,500 --> 00:01:56,620
wanataka magazeti nje.

38
00:01:56,620 --> 00:02:01,110
printf,% c kama placeholder yangu,
s bracket i.

39
00:02:01,110 --> 00:02:05,150
Chini ya mpango huu, hebu
tu magazeti nje newline hivyo kwamba yangu

40
00:02:05,150 --> 00:02:07,520
haraka inaonekana mpya
line yake mwenyewe.

41
00:02:07,520 --> 00:02:11,540
>> Hebu sasa kukusanya mpango huu
na kufanya capitalize0.

42
00:02:11,540 --> 00:02:13,900
Hebu kuendesha kwa capitalize0.

43
00:02:13,900 --> 00:02:17,190
Na hebu aina katika neno kama
hujambo katika yote lowercase.

44
00:02:17,190 --> 00:02:19,960
Mimi kupata nyuma HELLO katika uppercase
kama ilivyotarajiwa.

45
00:02:19,960 --> 00:02:25,210
Lakini hebu jaribu moja mtihani zaidi, wakati huu
kwa jina langu mwenyewe, D-A-V-I-D, lakini kwa

46
00:02:25,210 --> 00:02:28,170
D kwanza mtaji, tu katika
kesi mimi messed kitu juu

47
00:02:28,170 --> 00:02:29,430
na kwamba char kwanza.

48
00:02:29,430 --> 00:02:34,250
Kuingia, na D-A-V-I-D katika uppercase
ni kuchapishwa pia.

49
00:02:34,250 --> 00:02:36,873