摘要:
# includeint main(void){ int digit,letter,other; char ch; int i; digit=letter=other=0; printf("Enter 10 characters:"); for(i=1;i='a'&&ch='0'&&ch<='9') digit++; } printf("letter=%d,digit=%d,other=%d\n",letter,digit,other); return 0;} 阅读全文
摘要:
# includeint main(void){ double x,y; printf("Enter x:"); scanf("%lf",&x); if(x<0){ y=0; } else if(x<=15){ y=4*x/3; } else{ y=2.5*x-10.5; } printf("f(%.2f)=%.2f\n",x,y); return 0;} 阅读全文
摘要:
#includeint main(void){ int count,i,n; double grade,total; printf("Enter n:"); scanf("%d",&n); total=0; count=0; for(i=1;i<=n;i++){ printf("Enter grade#%d:",i); scanf("%dlf",&grade); total=total+grade; if(grade<60){ count++; } } printf("Grad 阅读全文