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

正文內(nèi)容

二級(jí)c語言題庫(編輯修改稿)

2024-09-12 12:19 本頁面
 

【文章內(nèi)容簡介】 (\nOutput from head:\n)。 outlist(head)。 printf(\nOutput from tail: \n)。 while (headnext != NULL){ fun(head)。 printf(\n\n)。 printf(\nOutput from head again :\n)。 outlist(head)。 } } 二、程序改錯(cuò)題 include /************found************/ fun (char a) { if ( *a ) { fun(a+1) 。 /************found************/ printf(%c *a) 。 } } main( ) { char s[10]=abcd。 printf(處理前字符串 =%s\n 處理后字符串 =, s)。 fun(s)。 printf(\n) 。 } 三、程序編寫題 include char *fun ( char *s, char *t) { } main( ) { char a[20],b[20]。 void NONO ( )。 printf(Input 1th string:) 。 gets( a)。 printf(Input 2th string:) 。 gets( b)。 printf(%s\n,fun (a, b ))。 NONO ()。 } void NONO ( ) {/* 本函數(shù)用于打開文件,輸入數(shù)據(jù),調(diào)用函數(shù),輸出數(shù)據(jù),關(guān)閉文件。 */ FILE *fp, *wf 。 int i 。 char a[20], b[20] 。 fp = fopen(K:\\k01\\24010001\\,r) 。 wf = fopen(K:\\k01\\24010001\\,w) 。 for(i = 0 。 i 10 。 i++) { fscanf(fp, %s %s, a, b) 。 fprintf(wf, %s\n, fun(a, b)) 。 } fclose(fp) 。 fclose(wf) 。 } 第 7 套題 一、程序填空題 include include define N 8 typedef struct list { int data。 struct list *next。 } SLIST。 void fun( SLIST *h) { SLIST *p, *q。 p=hnext。 if (p!=NULL) { q=pnext。 while(q!=NULL) { if (pdata==qdata) { pnext=qnext。 /**********found**********/ free(___1___)。 /**********found**********/ q=p___2___。 } else { p=q。 /**********found**********/ q=q___3___。 } } } } SLIST *creatlist(int *a) { SLIST *h,*p,*q。 int i。 h=p=(SLIST *)malloc(sizeof(SLIST))。 for(i=0。 iN。 i++) { q=(SLIST *)malloc(sizeof(SLIST))。 qdata=a[i]。 pnext=q。 p=q。 } pnext=0。 return h。 } void outlist(SLIST *h) { SLIST *p。 p=hnext。 if (p==NULL) printf(\nThe list is NULL!\n)。 else { printf(\nHead)。 do { printf(%d,pdata)。 p=pnext。 } while(p!=NULL)。 printf(End\n)。 } } main( ) { SLIST *head。 int a[N]={1,2,2,3,4,4,4,5}。 head=creatlist(a)。 printf(\nThe list before deleting :\n)。 outlist(head)。 fun(head)。 printf(\nThe list after deleting :\n)。 outlist(head)。 } 二、程序改錯(cuò)題 include define N 20 void fun(int a[], int n) { int i, j, t, p。 for (j = 0 。j n1 。j++) { /************found************/ p = j for (i = j+1。i n。 i++) if(a[i] a[p]) /************found************/ p = j。 t = a[p] 。 a[p] = a[j] 。 a[j] = t。 } } main() { int a[N]={9,6,8,3,1},i, m = 5。 printf(排序前的數(shù)據(jù) :) 。 for(i = 0。i m。i++) printf(%d ,a[i])。 printf(\n)。 fun(a,m)。 printf(排序后的數(shù)據(jù) :) 。 for(i = 0。i m。i++) printf(%d ,a[i])。 printf(\n)。 } 三、程序編寫題 include define M 100 void fun ( int m, int *a , int *n ) { } main( ) { int aa[M], n, k。 void NONO ( )。 fun ( 50, aa, amp。n )。 for ( k = 0。 k n。 k++ ) if((k+1)%20==0) printf(\n)。 else printf( %4d, aa[k] )。 printf(\n) 。 NONO( )。 } void NONO ( ) {/* 本函數(shù)用于打開文件,輸入數(shù)據(jù),調(diào)用函數(shù),輸出數(shù)據(jù),關(guān)閉文件。 */ FILE *fp, *wf 。 int i, n, j, k, aa[M], sum 。 fp = fopen(K:\\k01\\24010001\\,r) 。 wf = fopen(K:\\k01\\24010001\\,w) 。 for(i = 0 。 i 10 。 i++) { fscanf(fp, %d, amp。j) 。 fun(j, aa, amp。n) 。 sum = 0 。 for(k = 0 。 k n 。 k++) sum+=aa[k] 。 fprintf(wf, %d\n, sum) 。 } fclose(fp) 。 fclose(wf) 。 } 第 8 套題 一、程序填空題 include include define N 8 typedef struct list { int data。 struct list *next。 } SLIST。 SLIST *creatlist(char *)。 void outlist(SLIST *)。 int fun( SLIST *h, char ch) { SLIST *p。 int n=0。 p=hnext。 /**********found**********/ while(p!=__0_1___) { n++。 /**********found**********/ if (pdata==ch) return _n__2___。 else p=pnext。 } return 0。 } main() { SLIST *head。 int k。 char ch。 char a[N]={39。m39。,39。p39。,39。g39。,39。a39。,39。w39。,39。x39。,39。r39。,39。d39。}。 head=creatlist(a)。 outlist(head)。 printf(Enter a letter:)。 scanf(%c,amp。ch)。 /**********found**********/ k=fun(___3___)。 if (k==0) printf(\nNot found!\n)。 else printf(The sequence number is : %d\n,k)。 } SLIST *creatlist(char *a) { SLIST *h,*p,*q。 int i。 h=p=(SLIST *)malloc(sizeof(SLIST))。 for(i=0。 iN。 i++) { q=(SLIST *)malloc(sizeof(SLIST))。 qdata=a[i]。 pnext=q。 p=q。 } pnext=0。 return h。 } void outlist(SLIST *h) { SLIST *p。 p=hnext。 if (p==NULL) printf(\nThe list is NULL!\n)。 else { printf(\nHead)。 do { printf(%c,pdata)。 p=pnext。 } while(p!=NULL)。 printf(End\n)。 } } 二、程序改錯(cuò)題 include include include fun ( char *p) { int i,t。 char c[80]。 /************found************/ For (i = 0,t = 0。 p[i] 。 i++) if(!isspace(*(p+i))) c[t++]=p[i]。 /************found************/ c[t]=\0。 strcpy(p,c)。 } main( ) { char c,s[80]。 int i=0。 printf(Input a string:)。 c=getchar()。 while(c!=39。39。) { s[i]=c。i++。c=getchar()。 } s[i]=39。\039。 fun(s)。 puts(s)。 } 三、程序編寫題 include include void fun ( char *ss ) { } main( ) { char tt[81] 。 void NONO ( )。 printf( \nPlease enter an string within 80 characters:\n )。 gets( tt )。 printf( \n\nAfter changing, the string\n \%s\, tt )。 fun( tt )。 printf( \n
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1