首页 > TAG信息列表 > 暑假作业

暑假作业c语言41-50

#include<stdio.h> int fn(int a,int n) { int s; while(n>=0) { s=a*n+s; a=a*10; n--; } return s; } main() { int a1,n1,i; scanf("%d%d",&a1,&n1); print

暑假作业53题

#include<stdio.h> int main() { enum Color {red, yellow, blue, white, black}; enum Color i, j, k, pri; int n, loop; n = 0; for(i = red; i <= black; i++) for(j = red; j <= black; j++) if(i != j) { for(k = red; k <= black; k++) if((k != i) &am

暑假作业54题

#include<stdio.h> void main() { void exchange(float *q1,float *q2,float *q3); float a,b,c,*p1,*p2,*p3; scanf("%f,%f,%f",&a,&b,&c); p1=&a;p2=&b;p3=&c; exchange(p1,p2,p3); printf("%f,%f,%f",a,b,c); } void ex

第三周暑假作业

二级题库 double fun(double  *x) { int  i, j;    double  av, y[N];   av=0;   for(i=0; i<N; i++) /**********found**********/     av+=x[i]/N;   for(i=j=0; i<N; i++)     if( x[i]<av ){       y[j]=x[i]; x[i]=-1; /**********found**********/  

第二周暑假作业

二级题库 double fun(double  *x) { int  i, j;    double  s, av, y[N];   s=0;   for(i=0; i<N; i++)  s=s+x[i]; /**********found**********/   av=s/N;   for(i=j=0; i<N; i++)     if( x[i]>av ){ /**********found**********/       y[j++]=x[i];  

暑假作业

1, #include<stdio.h> even(int n) { if(n%2) return(1); else return(0); } main() { int n,sum=0; scanf("%d",&n); while(n) { if(even(n)) sum+=n; scanf("%d",&n); } printf("%d",sum); } 2. #include<stdio.h> #incl

暑假作业

1, #include<stdio.h> even(int n) { if(n%2) return(1); else return(0); } main() { int n,sum=0; scanf("%d",&n); while(n) { if(even(n)) sum+=n; scanf("%d",&n); } printf("%d",sum); } 2. #include<stdio.h> #incl

暑假作业第7题

#include<stdio.h> struct student { int num; char name[20]; char sex; int score[4]; int year; int mouth; int day; float aver; }stu[4]={{10031,“wanggang”,‘m’,72,83,90,82,1991,5,19}, {10032,“liming”,‘m’,88,92,78,78,1992,8,20}, {10033,“wangli”,‘f

暑假作业c语音1-10题

暑假作业1-10 1. #include<stdio.h> int even(int n); int main() { int n; int sum=0; while(1) { scanf("%d",&n); if(n<=0) break; if(even(n)==0) { sum+=n; } } printf("The sum of the odd numbers is %d\n",sum