程序实验设计作业

程序一

#include<stdio.h>

int main()

{

         int a,b,sum;

         a=123;

         b=456;

         sum=a+b;

         printf("sum is %d\n",sum);

         return 0;

}

程序二                       

#include<stdio.h>

int main()

{

         char c1,c2;

         c1=97;

         c2=98;

         printf("c1=%c,c2=%c\n",c1,c2);

         printf("c1=%d,c2=%d\n",c1,c2);

         return 0;

}

#include<stdio.h>

int main()

{

         char c1,c2;

         c1=197;

         c2=198;

         printf("c1=%c,c2=%c\n",c1,c2);

         printf("c1=%d,c2=%d\n",c1,c2);

         return 0;

}

 

 

 程序三

#include<stdio.h>

#include<math.h>

int main()

{

         int x,y,z;

         scanf("%d%d",&x,&y);

         z=x+1/abs(y);

         printf("%d\n%15.6f\n%e\n",z,(double)z,(double)z);

         return 0;

}

 

 

posted @ 2019-04-08 15:33  p201821440011  阅读(199)  评论(0编辑  收藏  举报