#define_CRT_SECURE_NO_WARNINGS<br>//输出一个整数的每一位<br>//1.低位输出到高位<br>#include<br>#include<br>intmain()<br>{<br>inta;<br>printf("请输出一个数");<br>scanf("%d",&a);<br>while(a)<br>{<br>printf("%d",a%10);<br>a=a/10;<br>}<br>system("pause");<br>return0;<br>}<br>2.高位输出到低位<br>#include<br>#include<br>#include<br>intmain()<br>{<br>inta,b;<br>intcount=0;<br>printf("请输入一个数");<br>scanf("%d",&a);<br>b=a;<br>while(b)<br>{<br>count++;<br>b=(b/10);<br>}<br>//printf("%d",(int)pow(10,count-1));<br>while(count)<br>{<br>b=a/(int)pow(10,count-1);<br>a=a-b*(int)pow(10,count-1);<br>printf("%d",b);<br>count--;<br>}<br>system("pause");<br>return0;<br>}<br>//计算1-1/2+1/3-1/4+1/5....-1/100<br>#include<br>#include<br>intmain()<br>{<br>doublesum,a,b,c;<br>sum=1;<br>a=2.0;<br>b=1.0;<br>c=1;<br>while(a