实验一

1.

#include<stdio.h>

int main()

{

 int a,b,sum;  

a=123;  

b=456;

 sum=a+b;  

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

return 0;

}

2.

#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);

}

3.

#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 "stdafx.h" #include <stdio.h> #include <math.h> int main(int argc, char* argv[]) {  int x,y;  float z;  scanf("%d\n",&x);     scanf("%d",&y);  z=x+1.0/abs(y);     printf("z=%d\n",(int)z);  printf("z=%15.6f\n",z);  printf("z=%e\n",z);  return 0;

}

posted on 2019-04-11 15:26  P201821430026  阅读(101)  评论(0编辑  收藏  举报