1. /*  顺序程序设计举例  */ 
  2.  
  3. // 温度.cpp : 定义控制台应用程序的入口点。  
  4. //  
  5.  
  6. #include "stdafx.h"  
  7.  
  8.  
  9. int _tmain(int argc, _TCHAR* argv[])  
  10. {  
  11.     float f,c;                      // 定义f和c为单精度浮点型变量  
  12.     f=64.0;                         // 指定f的值  
  13.     c=(5.0/9)*(f-32);               // 利用公式计算c的值  
  14.     printf("f=%f\nc=%f\n",f,c);  
  15.     return 0;  
  16. }  
  17.  
  18. // 利息.cpp : 定义控制台应用程序的入口点。  
  19. //  
  20.  
  21. #include "stdafx.h"  
  22.  
  23.  
  24. int _tmain(int argc, _TCHAR* argv[])  
  25. {  
  26.     float p0=1000,r1=0.0036,r2=0.0225,r3=0.0198,p1,p2,p3;   //定义变量  
  27.     p1=p0*(1+r1);  
  28.     p2=p0*(1+r2);  
  29.     p3=p0*(1+r3/2)*(1+r3/2);  
  30.     printf("p1=%f\np2=%f\np3=%f\n",p1,p2,p3);  
  31.     return 0;