freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

c語(yǔ)言課程設(shè)計(jì)(字符串函數(shù)包)-資料下載頁(yè)

2025-01-18 14:06本頁(yè)面
  

【正文】 *s1=39。\039。 } void mystrncpy(char *s1,char *s2,int g) //字符串前幾個(gè)字符的復(fù)制 { int i=1。 while(*s2!=39。\039。amp。amp。 i++=g) { *s1=*s2。 s1++。 s2++。 } *s1=39。\039。 } void mystrcat(char *s1,char *s2)//字符串的拼接 { while (*s1!=39。\039。) {s1++。} while(*s2!=39。\039。) { *s1=*s2。 s1++。s2++。 } *s1=39。\039。 }void mystrncat(char *s1,char *s2,int g)//字符串前幾個(gè)的拼接{ int i=1。 while(*s1!=39。\039。) {s1++。} while(*s2!=39。\039。amp。amp。 i++=g) {*s1=*s2。s1++。s2++。} *s1=39。\039。} int mystrlen (char*s)//字符串的長(zhǎng)度 { int c=0。 while(*s!=39。\039。) { c++。 s++。 } return c。 }char *my_itoa(int a,char *s)//整數(shù)轉(zhuǎn)換到字符串{ int t,i,b。 char str。 for(i=0。a0。i++) { t=a%10。 s[i]=t+48。 a=a/10。 } s[i]=39。\039。 if(i%2!=0){ for(b=1。b=i/2+1。b++,i){ str=s[b1]。 s[b1]=s[i1]。 s[i1]=str。 }} if(i%2==0){ for(b=1。b=i/2+1。b++,i) { str=s[a1]。 s[a1]=s[i1]。 s[i1]=str。 }}return s。} char * my_itof(double d, char* str) //浮點(diǎn)數(shù)轉(zhuǎn)換成字符串{ char str1[40]。 int i,j=0。 int index=0。 int dotPos = 0。 unsigned long num。 // 正負(fù)號(hào) if ( d 0 ) { str[index++] = 39。39。 d = 0 d。 } // 判斷小數(shù)點(diǎn)位置 for (i=0。 i10。 i++) { if (d = 1) { d = d / 10。 dotPos += 1。 } else if (d ) { d = d * 10。 dotPos = 1。 } else break。 } for (i=0。 i7。 i++) d *= 10。 num = (unsigned long)(d + )。 while ( num0 ) { str1[j++] = (char)num%10+39。039。 // 0098651 098651 num /= 10。 } if (dotPos 1) { str[index++] = 39。039。 str[index++] = 39。.39。 for (i=0。 i0dotPos。 i++) str[index++] = 39。039。 for (i=0。 ij。 i++) str[index++] = str1[j1i]。 } else { for (i=0。 idotPos。 i++) str[index++] = str1[j1i]。 str[index++] = 39。.39。 for (。 ij。 i++) str[index++] = str1[j1i]。 } // 清零 while ( str[index]==39。039。 )。 index++。 // 清除最后面的一個(gè)小數(shù)點(diǎn) 39。.39。 while ( str[index]==39。.39。 )。 str[++index] = 39。\039。 return(str)。 } long fun(char s[]){int i。 while(s[i]!=39。\039。){ s[i]=s[i]48。 //48為字符‘0’的ASCII碼, // 字符和整形數(shù)可以直接運(yùn)算,結(jié)果為整數(shù)輸出數(shù)組用%d就可以 i++。}}int my_strtoi(char *s) //字符串轉(zhuǎn)換成整數(shù){ int a,h=0。 while(*s!=39。\039。) { a=*s39。039。 h=h*10+a。 s++。 } return h。} void mystrlow(char*s) //大寫(xiě)字符變小寫(xiě){ while(*s!=39。\039。) { if(*s=39。A39。amp。amp。 *s=39。z39。) { *s+=32。} s++。 }}void mystrupr(char*s) //小寫(xiě)字符變大寫(xiě){ while(*s!=39。\039。) { if(*s=39。a39。amp。amp。 *s=39。z39。) { *s=32。} s++。 }} int mystrstrcount(char*s1,char*s2) //統(tǒng)計(jì)字符串中指定某子串出現(xiàn)的次數(shù){ int len2=mystrlen(s2)。 int len1=mystrlen(s1)。 int i,j,count1=0,count2=0。 for(i=0。i+len2len1。i++,count1=0) { for(j=0。jlen2。j++) { if(*(s1+i+j)==*(s2+j)) count1++。 } if(count1==len2) count2++。 count1=0。 } return count2。}int mystrstr(char*s1,char*s2)//統(tǒng)計(jì)字符串中指定某子串出現(xiàn)的首位置{ int len2=mystrlen(s2)。 int len1=mystrlen(s1)。 int i,j,count1=0,count2=0。 for(i=0。i+len2len1。i++,count1=0) { for(j=0。jlen2。j++) { if(*(s1+i+j)==*(s2+j)) count1++。 } if(count1==len2) return i+jlen2+1。 }}char *mystrptr(char *s1,char *s2)//判斷字符串中是否存在指定字符{ char *p。 while(*s1!=39。\039。) { p=s2。 while(*p!=39。\039。) { if(*s1==*p) { return(char*)s1。 } p++。 } s1++。 } return NULL。 }42
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1