实验一

#include "stdafx.h"

#include "stdio.h"

 

 

int main(int argc, char* argv[])

{

         int a,b,sum;

         a=123;

         b=456;

         sum=a+b;

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

         return 0;

}

                       

#include "stdafx.h"

 

#include "stdio.h"                                                                                                       

int main(int argc, char* argv[])

{

         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;

}

 

// shiyan2.cpp : Defines the entry point for the console application.

//

 

#include "stdafx.h"

 

#include "stdio.h"                                                                                                       

int main(int argc, char* argv[])

{

         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 "stdafx.h"

#include "math.h"

#include "stdio.h"

int main(int argc, char* argv[])

{

         double x,y,z;    int p;

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

         y=abs(y);

         z=x+1/y;    p=x+1/y;    z=x+1/y;

                   printf("z=%15.6lf\nz=%d\nz=%e\n",z,p,z);           

                                                     

         return 0;

}

posted @ 2019-04-08 15:09  嘴哥  阅读(187)  评论(0)    收藏  举报