main() { int x,y,z,i,w,math,eng,chin,pe,facebook; char ch,x1,x2,x3,z1,z2,z3; printf("B10234567 xxx\n"); /*-----減法-----*/ x =50,y =10,z =x-y; printf("x-y= %d\n",z); /*-----char-----*/ ch =65; printf("ch = %c\n",ch); x1 =85,x2 =67,x3 =72; printf("char %c%c%c\n",x1,x2,x3); /*-----溢位-----*/ z1 =129,z2 =1,z3 =z1+z2; printf("z1+z2= %d \n",z3); /*-----整數與精數-----*/ w=(3+8)/2,math=69,eng=71,chin=73,pe=77,facebook=91; printf("w= %d\n",w); printf("(math+eng+chin+pe+facebook)/5= %f\n",(float)(math+eng+chin+pe+facebook)/5); /*-----char迴圈-----*/ for (i=1;i<=128;i++) printf("ch%d--> %c\n",i,i); system("pause"); }
留言
張貼留言