摘要:
#includeint main(void){ char op; printf("输入五级制成绩:"); scanf("%c",&op); switch(op){ case'A':printf("grade=90-100"); break; case'B':printf("grade=80-89"); break; case'C':printf("grade=70-79"); break; case'D':printf(&q 阅读全文
摘要:
#includeint main(void){ int i,n,year; printf("Enter n:"); scanf("%d",&n); for(i=1;i<=n;i++){ printf("Enter year:"); scanf("%d",&year); if((year%4==0&&year%100!=0)||(year%400==0)){ printf("这是闰年"); } else{ printf("这不是闰年"); 阅读全文
摘要:
#includeint main(void){ int x,y; printf("输入x:"); scanf("%d",&x); if(x<0){ y=-1; } else if(x==0){ y=0; } else{ y=1; } printf("y=%d",y); return 0;} 阅读全文
摘要:
#includeint main(void){ int digit,space,enter,letter,other; char ch; int i; digit=space=enter=letter=other=0; printf("Enter 15 characters:"); for(i=1;i='a'&&='A'&&='0'&&ch<='9') digit++; else if(ch=' ') space++; else if(ch= 阅读全文
摘要:
#includeint main (void){ int count,i,n; double grade,total; printf("Enter n:"); scanf("%d",&n); total=0; count=0; for(i=1;i=60){ count++; } } printf("Grade average=%.2f\n",total/n); printf("Number of failures=%d\n",count); return 0;} 阅读全文
摘要:
#include int main(void) { int i,n; double x; double fact(int n); scanf ("%d", &n); x=0; for(i=0;i<=n;i++){ x=x+fact(i); } printf("x=%.0f\n",x); return 0;}double fact(int n) { int i; double y; y=1; for(i=1;i<=n;i++){ ... 阅读全文
摘要:
#includeint main(void){ int n,i; double x,y; y=1; printf("输入n,x:"); scanf("%d%Lf",&n,&x); for(i=1;i<=n;i++){ y=y*x; } printf("y=%Lf",y); return 0;} 阅读全文
摘要:
#includeint main(void){ int i,n,numerator,denominator,flag; double sum,item; printf("Enter n:"); scanf("%d",&n); numerator=1; denominator=1; sum=0; flag=1; for(i=1;i<=n;i++){ item=flag*(numerator*1.0/denominator); numerator=numerator+1; denominator... 阅读全文
摘要:
#includeint main(void){ int m,n; double i,y; y=1; printf("输入m,n的值:"); scanf("%d%d",&m,&n); for(i=m;i<=n;i++){ y=y+(i*i+1/i); } printf("y=%Lf",y); return 0;} 阅读全文
摘要:
#include #include int main(void) { int year; double loan,money,my,rate; scanf("%Lf",&loan); scanf("%Lf",&rate); printf("year money\n"); for(year=5;year<=30;year++){ my=pow(1+rate,12*year); money=loan*rate*my/(my-1); printf("year=%d money=%.0f\n",yea 阅读全文