#include
printf(\ b: \ scanf(\ k=hcf(/**/ a, b /**/); printf(\ getch(); }
int hcf(int x,int y) { int r; r=x%y; while( r!=0 ) { x=y;
y=/**/ r /**/; r=x%y ; }
return (/**/ y /**/); }
#include
char s1[100], s2[100]; int i,len;
printf(\ gets(s1);
len = strlen(s1); for(i=0; i if( s1[i] >= '1' && s1[i] <= '9') /**/ s2[i]=s1[i]-1; /**/ else if( s1[i] == '0' ) /**/ s2[i]=’9’; /**/ else s2[i] = s1[i]; } s2[i] =/**/ 0 (或者: ’\\0’ ) /**/; puts(s2); getch(); } #include #include void sct(char s1[],/**/ char s2[] /**/) {char * p1,*p2; p1=/**/ s1 /**/; p2=s2; while(*p1) p1++; while(*p2) *(p1++) = *(p2++); } void main() { char str1[60]=\ sct(/**/ str1 /**/ ,str2); printf(\ getch(); } 三、编程题 #include { /**/ double y; y=(3*x*sin(x)+tan(x))/(1.5+fabs(x)); return y; /**/ } void main() { clrscr(); printf(\ printf(\ printf(\ getch(); } #include for(i=0;i for(i=0;i void main() { int a[] = {23,40,8,32,18,2,9,16,27}; int i,k = sizeof(a)/sizeof(int); int count=0; float aver=0.0; printf(\ for(i=0;i count=fun(a,k,&aver); printf(\ count is %d\\n\ getch(); } #include y=(exp(x)+sin(x-6))/(x*x+1); return y; /**/ } void main() { clrscr(); printf(\ printf(\ printf(\ getch(); } #include int find(int a[],int n,float x) { /**/ int i ,t; float min=fabs(x-a[0]); for(i=1;i return t; /**/ } void main() { int a[] = {23,40,8,32,18,2,9,16,27}; int i,k,n = sizeof(a)/sizeof(int); float x=20.3; printf(\ for(i=0;i printf(\ getch(); } #include else y=cos(2*x+1); return y; /**/ } void main() { float x; double y; clrscr(); printf(\ scanf(\ y = fun1(x); printf(\ getch(); } #include { /**/ int i , j, t=0; for(i=bg;i<=fn;i++) { for(j=2;j=i/2) t++; } return t; /**/ } void main() { int count; count=fun(100,500); printf(\ getch(); } #include double fun1(float x) { /**/ double y; if(x<3) y=pow(2.5+fabs(x),1.0/3)/(sin(x)+3); else y=x; return y; /**/ } void main() { float x; double y; clrscr(); printf(\ scanf(\ y = fun1(x); printf(\ getch(); }