WEO啦

首页 » 正文内容 » 实验二三参考答案
实验二三参考答案
收录时间:2022-11-25 21:38:38  浏览:0
实验二2_2/#includeint main(void)printf(The size of int is %d/n/sizeof(int)/printf(The size of long is %d/n/sizeof(long)/printf(The size of float is %d/n/sizeof(float)/printf(The size of double is %d/n/sizeof(double)/printf(The size of char is %d/n/sizeof(char)/return 0/2_5/#includeint main(void)printf(1/ %cn/E)/printf(2/ %cn/105)/printf(3/ %cn/x45)/return 0/2_7/#includeint main(void)int length/width/height/volume/printf(please input length/width/height/)/ scanf(%d/%d/%d/&length/&width/&height)/ volume=length*width*height/printf(the volume is %dn/volume)/return 0/2_8/#includeint main(void)enum colorRed/Green/Blue/enum color R/G/B/*pr/*pg/*pb/R=Red/G=Green/B=Blue/pr=&R/pg=&G/pb=&B/printf(%d-%d-%dn/*pr/*pg/*pb)/ return 0/实验三3_2/#include#includeint main(void)unsigned int a/b/n/mode/clrscr()/ scanf(%u/&a)/ n=16/ b=a/ mode=0x8000/ printf(%u in binary format is//a)/ while(n0) printf(%d/b/mode)/ b=b%mode/ mode=mode/2/ n=n-1/ printf(n)/ return 0/3_3/#include#include#includeint main(void)float num/sign/deci/int inte/clrscr()/printf(please input a real number/)/scanf(%f/&num)/if(num0)printf(sign/+n)/elseif(num0)printf(sign/-n)/elseprintf(sign/0n)/inte=num/deci=num-inte/printf(integral part/ %dn/abs(inte)/printf(decimal fraction part/ %fn/fabs(deci)/ return 0/3_4/#include#includeint main(void)unsigned int num/kilobit/cenbit/tenbit/indivbit/clrscr()/ scanf(%u/&num)/kilobit=num/1000/cenbit=num/100%10/tenbit=num/10%10/indivbit=num%10/ printf(%u can be seperated to/%u-%u-%u-%un/num/kilobit/cenbit/tenbit/indivbit)/ return 0/3_5/#include#include#includeint main(void)double x/y/a/b/c/d/e/clrscr()/ printf(input two numbers/)/scanf(%lf/%lf/&x/&y)/a=sin(x)/b=cos(x)/c=fabs(x)/ d=exp(x)/e=pow(x/y)/ printf(sin(%f)=%fn/x/a)/ printf(cos(%f)=%fn/x/b)/ printf(|%f|=%fn/x/c)/ printf(exp(%f)=%fn/x/d)/ printf(pow(%f/%f)=%fn/x/y/e)/ return 0/3_6/#include#include#includeint main(void)int a/b/c/float s/area/clrscr()/printf(input the length of triangle/ )/scanf(%d/%d/%d/&a/&b/&c)/s=(a+b+c)/2/0/area=sqrt(s*(s-a)*(s-b)*(s-c)/printf(the area of triangle is/%fn/area)/return 0/3_7/#include#includeint main(void)float num=100/453627/clrscr()/printf(%f-%10/1fn/num/num)/printf(%f-%10/2fn/num/num)/printf(%f-%10/3fn/num/num)/printf(%f-%10/4fn/num/num)/return 0/3_8/#include#includeint main(void)char p1name/p2name/float p1math/p1phy/p1chem/float p2math/p2phy/p2chem/float p1average/p1sum/float p2average/p2sum/clrscr()/printf(Please input student 1s name/)/scanf( %c/&p1name)/printf(Math/)/scanf(%f/&p1math)/printf(Physics/)/scanf(%f/&p1phy)/printf(Chemstry/)/scanf(%f/&p1chem)/p1sum=p1math+p1phy+p1chem/p1average=p1sum/3/printf(Please input student 2s name/)/scanf( %c/&p2name)/printf(Math/)/scanf(%f/&p2math)/printf(Physics/)/scanf(%f/&p2phy)/printf(Chemstry/)/scanf(%f/&p2chem)/p2sum=p2math+p2phy+p2chem/p2average=p2sum/3/printf(*n)/printf(* NAME MATH PHYSICS CHEMSTRY SUM AVERAGE *n)/printf(*%5c%7/1f%8/1f%9/1f%6/1f%8/1f
温馨提示:
1. WEO啦仅展示《实验二三参考答案》的部分公开内容,版权归原著者或相关公司所有。
2. 文档内容来源于互联网免费公开的渠道,若文档所含内容侵犯了您的版权或隐私,请通知我们立即删除。
3. 当前页面地址:https://www.weo.la/doc/747d7a6e7a398d6b.html 复制内容请保留相关链接。