strlen計(jì)算字符串長(zhǎng)度怎么數(shù) 輸入一個(gè)字符串,計(jì)算其長(zhǎng)度(不用strlen函數(shù))?
輸入一個(gè)字符串,計(jì)算其長(zhǎng)度(不用strlen函數(shù))?#Include main(){chartr[20]inti,J printf(“please input string:”)scanf(%s”,S
輸入一個(gè)字符串,計(jì)算其長(zhǎng)度(不用strlen函數(shù))?
#Include main(){chartr[20]inti,J printf(“please input string:”)scanf(%s”,STR)//為(J=0j<20j){if(STR[J]輸入字符串!=“0”{I}else{break}printf(“字符串的長(zhǎng)度是%d”,I)//輸出}