摘要:
#include #include int main(void) { int money,year; double rate,sum;printf("Enter money:"); scanf("%d",&money); printf("Enter year:"); scanf("%d",&year); printf("Enter rate:"); scanf("%lf",&rate); sum=money*pow(1+rate,year); prin 阅读全文
摘要:
#include int main(void) { double x,y;printf("Enter x(x>=0):\n"); scanf("%lf",&x);if(x<=15){ y=4*x/3; } else{ y=2.5*x-10.5; } printf("y=f(%f)=%.2f\n",x,y); return 0; } 阅读全文
摘要:
#include int main(void) { int celsius,fahr;fahr=100; celsius=5*(fahr-32)/9;printf("fahr=%d,celsius=%d\n",fahr,celsius);return 0; } 阅读全文
摘要:
#include int main(void) { printf("Programming is fun.\n"); printf("And programming in C is even more fun!\n");return 0; } 阅读全文
摘要:
/*显示“Hello World!”*/ #include int main(void){ printf("Hello World!\n");return 0;} 阅读全文
摘要:
#include int main(void) { int n; int factorial(int n); scanf("%d",&n); printf("%d\n",factorial(n)); return 0; }int factorial(int n) { int i,fact=1; for(i=1;i<=n;i++) fact=fact*i; return fact; } 阅读全文