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

正文內容

程序設計技術(3版)習題參考答案-資料下載頁

2025-06-27 16:40本頁面
  

【正文】 ord)) printf(\n%s is a palindrome.,word)。 else printf(\n%s is not a palindrome.,word)。 }//include int Isdigit(char c){ if(c=39。039。amp。amp。c=39。939。) return 1。 return 0。}void main(){ char p[80],tmp[80],*s=p,flag=0。 int num=0。 gets(s)。 while(*s) { if(Isdigit(*s)) { tmp[num]=*s。 num++。 flag=1。 } if(flagamp。amp。Isdigit(*(s+1))==0) { tmp[num]=39。\039。 printf(\n%s,tmp)。 flag=0。 num=0。 } s++。 }}//include include void invertp(char *p){ static int len,k=0。 int tmp。 len=strlen(p)。 if(klen/21) return。 tmp=*(p+k)。 *(p+k)=*(p+lenk1)。 *(p+lenk1)=tmp。 k++。 invertp(p)。 }void main(){ char string[80]=1234567。 invertp(string)。 printf(\nThe new string is:%s,string)。 }//include void Myput(char *s){ while(*s!=39。\039。) printf(%c,*s++)。 printf(\n)。}void main(){ char word[80]=How are You!。 Myput(word)。 }//include include void main(){ char s[100]。 int k。 printf(\nInput String s:)。 gets(s)。 for(k=0。s[k]!=0。k++) { if(s[k]=39。A39。amp。amp。s[k]=39。U39。) { s[k]+=5。 continue。 } if(s[k]=39。V39。amp。amp。s[k]=39。Z39。) s[k]=s[k]+526。 } printf(\nThe new string is:%s,s)。 }//include include include void to_lowcase(char *s){ while(*s) { if(*s=39。A39。amp。amp。*s=39。Z39。) *s+=32。 s++。 }}int My_Find(char *p1,char *p2){ char *s1,*s2,*p,*t1,*t2。 int len2,num=0。 s1=(char *)malloc(strlen(p1)+1)。 s2=(char *)malloc(strlen(p2)+1)。 t1=s1。 t2=s2。 strcpy(s1,p1)。 strcpy(s2,p2)。 to_lowcase(s1)。 to_lowcase(s2)。 len2=strlen(p2)。 while((p=strstr(s1,s2))amp。amp。len2!=0) { num++。 s1=p+strlen(s2)。 } free(t1)。 free(t2)。 return num。}void main(){ char s1[100],s2[50]。 int len2。 printf(\nInput String s1:)。 gets(s1)。 printf(\nInput string s2:)。 gets(s2)。 len2=My_Find(s1,s2)。 printf(\nnum=%d,len2)。 }//include include void main(){ char word[80]。 int max=0,len,k=0,ptmp。 puts(Input a string:)。 gets(word)。 len=strlen(word)。 while(word[k]) { while(word[k]==39。 39。) k++。 len=0。 while(word[k]!=39。 39。amp。amp。word[k]) { len++。 k++。 } if(maxlen) { max=len。 ptmp=kmax。 } } printf(\nThe word is:)。 for(k=ptmp。kptmp+max。k++) printf(%c,word[k])。}習題8一、單項選擇題 DCCDA DDDDB二、填空題① 若干個數據項② 結構體成員③ 定義結構體數據類型的變量④ 同時存在⑤ 同時⑥ 需要存儲區(qū)域最大的一個分配存儲空間⑦ long *⑧ char *⑨ double *三、閱讀程序題1. 110,z2. ascalbasicb3. 5,34. 5160215. li ming 196. abcdefghijk四、程序設計題//include struct p{ double re。 double im。}。typedef struct p COMP。void main(){ COMP sub(COMP x,COMP y)。 COMP a,b,res。 printf(Input plex num a:)。 scanf(%lf,%f,amp。,amp。)。 printf(Input plex num b:)。 scanf(%lf,%f,amp。,amp。)。 res=sub(a,b)。 printf(=%g,=%g\n,)。}COMP sub(COMP x,COMP y){ COMP t。 =。 =。 return t。}//include include void main(){ struct node { int x。 struct node *next。 }。 int n。 struct node *h=NULL,*p,*q。 printf(Input a number: )。 scanf(%d,amp。n)。 while(n) { p=(struct node *)malloc(sizeof(struct node))。 px=n。 pnext=h。 if(!h) h=p。 else if(n=hx) { pnext=h。 h=p。 } else { q=h。 while(qnextamp。amp。nqnextx) q=qnext。 pnext=qnext。 qnext=p。 } printf(Input a number: )。 scanf(%d,amp。n)。 } p=h。 n=0。 while(p) { printf(%8d,px)。 if(++n%6==0) printf(\n)。 p=pnext。 } printf(\n)。}//include include define N 3struct stud{ char id[5]。 char name[20]。 int score[4]。 double ave。}。void inputscore(struct stud *rec)。void printscore(struct stud *s)。void sum_ave(struct stud *s)。void main(){ struct stud st[N]。 int i。 for(i=0。iN。i++) inputscore(amp。st[i])。 sum_ave(st)。 printscore(st)。}void inputscore(struct stud *rec){ int i。 char in_buf[10]。 gets(recid)。 gets(recname)。 for(i=0。i4。i++) { gets(in_buf)。 recscore[i]=atoi(in_buf)。 }}void sum_ave(struct stud *s){ int k,i,sum。 for(k=0。kN。k++) { sum=0。 for(i=0。i4。i++) sum+=s[k].score[i]。 s[k].ave=sum/4。 }}void printscore(struct stud *s){ int i,k。 for(k=0。kN。k++) { printf(%s\t%s:,s[k].id,s[k].name)。 for(i=0。i4。i++) printf(%5d,s[k].score[i])。 printf(\t%f\n,s[k].ave)。 }}//include include define N 10void main(){ void reverse(int v[],int n)。 int arr[N],i。 printf(Input the element of array:\n)。 for(i=0。iN。i++) scanf(%d,amp。arr[i])。 reverse(arr,N)。 for(i=0。iN。i++) printf(%5d,arr[i])。 printf(\n)。}void reverse(int v[],int n){ struct node { int x。 struct node *next。 }。 struct node *h=NULL,*p。 int i。 for(i=0。in。i++) { p=(struct node *)malloc(sizeof(struct node))。 px=v[i]。 pnext=h。 h=p。 } p=h。 for(i=0。p。i++,p=pnext) v[i]=px。}//include define N 3struct stu{ long id。 double shu,yu,ave。}。void main(){ struct stu s[N]。 void sort(struct stu v[],int n)。 struct stu *p。 for(p=s。ps+N。p++) { scanf(%ld,%lf,%lf,amp。(pid),amp。(pshu),amp。(pyu))。 pave=(pshu+pyu)/2。 } sort(s,N)。 for(p=s。ps+N。p++) printf(%ld% % %\n,pid,pshu,pyu,pave)。}void sort(struct stu v[],int n){ int i,j,k。 struct stu t。 for(i=0。in1。i++) { k=i。 for(j=i+1。jn。j++) if((*(v+j)).ave(*(v+k)).ave) k=j。 if(k!=i) t=*(v+i),*(v+i)=*(v+k),*(v+k)=t。 }}//include include struct list{ int d。 struct list *link。}。typedef struct list L。void main(){ L *createlist()。 void printlist(L *h)。 L *head。 head=createlist()。 printlist(head)。}L *createlist(){ L *p,*q,*ph。 int a。 ph=(L *)malloc(sizeof(L))。 p=q=ph。 printf(Input the element of list,1 for end.\n)。 scanf(%d,amp。a)。 while(a!=1) { p=(
點擊復制文檔內容
環(huán)評公示相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1