?? C : ??? ?? ??? ?? ???? ??
Apr 03, 2025 pm 08:15 PMC ?? ?????? ??? ?? ?? ?? ? ????? ???? ????. ? ??? ??? ?? ? ???? ? ??? ?? ??? ?? ????? ??? ????. ? ?? C? ?? ?? ? ?? ??? ??? ?? ??? ???? ??,?? ? ??? ? ????.
??? ?? ??
??? ?? ?????.
<code class="c">#include <stdio.h> #include <string.h> // 函數(shù)聲明void addcontact(char name[], char number[]); void viewcontacts(); void deletecontact(char name[]); int main() { int choice; char name[20]; char number[20]; printf("-- 歡迎使用您的電話簿! -- \n"); do { // 顯示菜單printf("\n您想執(zhí)行什么操作?\n"); printf("1. 創(chuàng)建新聯(lián)系人\t 2. 查看電話簿\t 3. 刪除聯(lián)系人\t 4. 退出\n"); scanf("%d", &choice); switch (choice) { case 1: // 添加新聯(lián)系人printf("很好,讓我們創(chuàng)建一個新聯(lián)系人:\n"); printf("請輸入聯(lián)系人的姓名:\n"); scanf("%s", name); printf("現(xiàn)在輸入電話號碼:\n"); scanf("%s", number); addcontact(name, number); break; case 2: // 查看電話簿printf("這是您的電話簿:\n"); viewcontacts(); break; case 3: // 刪除聯(lián)系人printf("請輸入要刪除的聯(lián)系人的姓名:\n"); scanf("%s", name); deletecontact(name); break; } } while (choice != 4); // 循環(huán)直到用戶選擇“退出” return 0; } // 向電話簿添加聯(lián)系人的函數(shù)void addcontact(char name[], char number[]) { FILE *pfile; pfile = fopen("phonebook.txt", "a"); if (pfile == NULL) { printf("打開電話簿失敗。"); return; } fprintf(pfile, "姓名: %s \t 電話: %s\n", name, number); printf("聯(lián)系人已創(chuàng)建!\n"); fclose(pfile); } // 查看電話簿中所有聯(lián)系人的函數(shù)void viewcontacts() { char filecontent[200]; FILE *pfile; pfile = fopen("phonebook.txt", "r"); while (fgets(filecontent, sizeof(filecontent), pfile)) { printf("\n%s", filecontent); } fclose(pfile); } // 從電話簿中刪除聯(lián)系人的函數(shù)void deletecontact(char name[]) { FILE *pfile, *ptrash; char line[200], contactname[20], contactnumber[20]; pfile = fopen("phonebook.txt", "r"); ptrash = fopen("trash.txt", "w"); if (pfile == NULL || ptrash == NULL) { printf("打開文件失敗。"); return; } while (fgets(line, sizeof(line), pfile)) { sscanf(line, "姓名: %s \t 電話: %s\n", contactname, contactnumber); if (strcmp(name, contactname) != 0) { fputs(line, ptrash); } } fclose(pfile); fclose(ptrash); // 將舊電話簿替換為更新后的版本remove("phonebook.txt"); rename("trash.txt", "phonebook.txt"); printf("聯(lián)系人已刪除。"); }</string.h></stdio.h></code>
???? ??
? ????? ? ?? ?? ??? ?????.
- ??? ?? :
- ???? ??? ?? ??? ?? ? ? ????.
-
phonebook.txt
?? ??? ??? ??? ??????.
- ????? :
-
phonebook.txt
??? ??? ?? ??? ??? ?? ?????.
-
- ??? ?? :
- ???? ?? ? ??? ?? ???? ??????.
- ?? ??? ???? ?? ? ???? ????? ?? ??? ??????.
?? ??
? ??? ?? ?? ??? ?? C ?? ??? ??????.
- ?? ?? :
fopen
,fclose
? ?? ?? ?? ??? ???? ? ???? ?? ?? ??? ?????. - ??? ?? :
strcmp
?sscanf
? ?? ??? ???? ???? ???? ?? ?????. - ?? ??? ?? : ??? ??? ??? ???? ???? ???? ??? ??? ?? ??? ???? ?? ???? ????????.
?? ???
- ???
.c
?? (? :phonebook.c
)? ???? C ???? (? : GCC)? ??????.
<code class="bash">gcc -o phonebook phonebook.c</code>
- ??? ? ???? ?? :
<code class="bash">./phonebook</code>
- ? ??? ????? ?? ???? ??,?? ?? ??????.
-
phonebook.txt
??? ?? ???? ???? ???? ??? ??????.
?? ??
? ????? ?? ???? ?? ??? ?? ?? ??? ??? ? ????.
- ?? ?? : ?? ??? ???? ?? ?? ?? (? : ?? ? ??)? ???? ??????.
- ??? ????? ?? : ??? ????? ???? ?? ??? ?? ? ??? ?? ? ? ???? (
scanf
??fgets
??). - ??? ?? ?? : CSV ?? JSON? ???? ??? ? ?? ??? ???? ?? ????? ??? ???? ??????.
- ?? ?? : ?? ??? ???? ???? ?????? ?????.
??
? ??? ??? C ?? ?? ?? ? ?? ??? ??? ???? ? ????????. ????? ??? ????? ??? ? ??? ????? ???? ???????. C Language? ????? ??? ?? ?? ????! ??? ???? ???? ?? ?????.
? ??? ?? C : ??? ?? ??? ?? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











?? ??? ???? ?? ?? ? ?? ??? ????? ?? ???? ??? ??? ??? ????? ??????. ?? ???? ???? ???? ????? ? ? ??? ??????? ??????? ????? ????? ? ??? ? ?? ???? ?? ?? ???? ???? ???? ??? ??? ??? ????? ?? ?? ??? ?? ?? ??? ? ? ??? ? ????.

?? Bitcoin? ??? ??? ??? Dogecoin? ??? ???? ???? ??? ??????. ????, ??? ?? ??? ??? ??? ???? Ethereum? ??? ?? ? ??? ??? ??? ??? ??? ????.

?? ?? ??? ??? "??? ??, ?? ?? ?, ? ?? ?? ??"? ??? ?????. ?? ??? ??? ???? ?? ??? ??? ??? Solana, Avalanche ? ?? ???? ??? ???? ????. ??, ?? ???? ??? ? Polkadot, Cosmos? ??? ??? ? ChainLink? ???? ?? ??? ?? ??? ?????. ???? ???? ?? ?? ???? ???? ?? ? ?? ?? ??? ???? ?? ??? ?? ??, ??, ?? ? ?? ?? ??? ?? ??? ?????.

Cardano? Alonzo Hard Fork ?????? Plutus ??? ?? ???? ???? Cardano? ? ?? ?????? ??? ???? ??? ?? ????? ????? ??????. 1. Plutus? ??? ??, ??? ?? ? ?? ??? ?? ??? ?? Haskell ??? ???????. 2. ????? ? DAPPS ??? ????? ??? ????? ???? Defi ? NFT ???? ??? ???? ????. 3. 2025 ?? Cardano ???? ? ???? ?? ? ????. Basho ??? ?? ? ??, ??? ?? ?? ??? ??, Voltaire ??? ?? ????? ?? ? ?? ??? ?? ????? ?? ?? ??? ??? ?? Cardano? ???? ????.

?? ?? ?? ?? ?? ??? ???? ???? ?? ??? ??? ??? ? ???. ?? ????? ??????? ?? ?????. ? ??? ?? ??? ???? ??, ?? ? ????? ?? ?? ? ??? ????? ?????? ?? ??? ??? ? ????? ???? ?? ?? ??? ?? ??? ? ??? ?????.

Stablecoins? ?? ??? ?? ?? ??? ???? ?? ???? ???? ??? ?????. ?? ??? ?? ??, ??? ?? ?? ? ???? ???? ? ?? ??? ????. 1. USDT? ??? ?? ???? ?? ??? ?? ?? ???? ?? ?? ??? ????. 2. USDC? Circle and Coinbase? ??? Center Alliance? ?? ???? ???? ??? ?????. 3. DAI? ??? ??? ??? ?? ??? ?? Makerdao? ?? ???? Defi ??? ?? ?????. 4. Busd? Paxos? ????? ?? ?????? ??? ?? ?????? ???????. 5. TUSD? ?? ???? ??? ?? ?? ??? ?? ??? ?????. ???? Binance, Ouyi ? Huobi? ?? ?? ???? ??? ? ????.

2025 ?? ?? ??? ??? ???? BTC, ETH, SOL ?? ????, ?? ?? ??, ??? 2, AI, Defi ? Gaming? ?? ?? ??? ????. 1.BTC? Digital Yellow Metal ??? ETF? ???? ??? ?? ??? ????. 2. ??? ?? ???? ?? ? ?????? ?? ???? ?????. 3. Sol? ??? ?? ?? ? ??? ????? ??????. 4. ??? ?? ???? ???? Oracle? ?????. 5. RNDR? ?? ? GPU ???? ??? AI ??? ?????. 6. imx? web3 ??? ??? ?? ????? ??? ?????. 7. ARB? ??? ?? 2 ??? ??? ?? ???? ?????. 8. MATIC? ?? ?? ??? ?? ?? ??? ?? ????????.

??? ??? ?? ??? ??? ??? ???????. ?? ???? ?? ? ?? ? Dogecoin Doge? ?? ???? ?? ? ????????. ???? "??"???? ?? ?? ?? ??? ? Binance?? ??? ?????? ??? ??? ??? ???? ??? ???? ?? ??? ??? ??? ?? ?? ??? ??? ???? ? ?? ???? ?? ??? ???????.
