12.1
#include <stdio.h>struct student{char sno[10];char sname[20];int age;char sex[3];char Xibie[5];char tel[11] ; int ach;}; int main () {int i;student class3[31];for (i=0;i<31;i++) {scanf ("%s%s%d%s%s%s%d",class[i].sno,class[i].sname,& Class[i].age,&class[i].sex,&class[i].xibie,&class[i].tel,&class[i].ach);} for (i=0;i<31;i++) {printf ("%s%s%d%s%s%s%d", Class[i].sno,class[i].sname,class[i].age,class[i].sex,class[i]. Xibie,class[i].tel,class[i].ach);p rintf ("\ n");} return 0;}
12.2
#include <stdio.h>#include<stdlib.h>structzuoye{Chara[ -];};intMain () {Zuoye wupeng[1]; FILE*fp=fopen ("F:\\input.txt","R"); while(!feof (FP)) {fscanf (FP),"%s", wupeng[0].a); Fclose (FP); } FP=fopen ("F:\\output.txt","W"); while(!feof (FP)) {fprintf (FP),"%s", wupeng[0].a); Fclose (FP);} return 0; }
12.3
#include <stdio.h>#include<stdlib.h>voidS1 () { Do{FILE*fp=fopen ("F:\\student.txt","A +"); printf ("Please enter the number of the study:"); scanf ("%s", Class3.xuehao); printf ("Please enter your name:"); scanf ("%s", Class3.name); printf ("Please enter your age:"); scanf ("%s",&class3.age) age; fprintf (FP,"\n%s%s%d", Class3.xuehao,class3.name,class3.age); printf ("The student information added successfully, whether to continue adding (0\1)"); intA; scanf ("%d",&a); } while(b==1) ;}structstudent{Charxuehao[Ten]; Charname[ -]; intAge ;}intMain () {printf ("----------Student Management system----------\ n"); printf ("1. Add student information \ n"); printf ("2. Query student information \ n"); printf ("3. Modify student information \ n"); printf ("4. Delete Student information \ n"); printf ("Please select: \ n"); Student class3[ to]; return 0;}
11.1
#include <stdio.h>voidAddint*p){ intI,add=0; for(i=0;i<5; i++)
{Add=add+* (P+i);
} printf ("%d", add);}intMain () {intA[]={22,33,44,0, One}; int*p=A; Add (p);return 0;}
11.2
#include <stdio.h>#include<string.h>intMain () {Chara[5]; Char*p; P=A; inti,j,t; printf ("Please enter a string:"); for(i=0;i<5; i++) scanf ("%c",&P[i]); for(i=0;i<5; i++) { for(j=4;j>0; j--) { if(a[j]<a[j-1]) {T=A[j]; A[J]=a[j-1]; A[j-1]=T; }}} printf ("from small to large for:"); for(i=0;i<5; i++) printf ("%c", *p++); return 0; }
11.3
#include <stdio.h>#include<malloc.h>intMain () {int*p, I; F= (int*) malloc (sizeof(int)*Ten); printf ("Please enter a 10 number:"); for(i=0;i<Ten; i++) {scanf ("%d", p++); } for(i=0;i<Ten; i++) {printf ("%d", * (P+i)); } return 0;}
11.4
#include <stdio.h>#include<stdlib.h>intMain () {inta[Ten][Ten]; int* p[Ten]; inti,j; for(i=0;i<Ten; i++) {P[i]=A[i]; } for(i=0;i<Ten; i++) { for(j=0;j<Ten; j + +) { *p (i+j) = (i+1) * (j+1); } } for(i=0;i<Ten; i++) { for(j=0;j<Ten; j + +) {printf ("%02d", *p (I+J)); } printf ("\ n"); } return 0;}
11 Jobs plus 12 jobs