
C语言问题
若a=3,b=4,c=5,x=1.2.y=2.4,z=-3.6,u=51274,n=128765,c1=‘a’,c2=‘b’。若想得到以下输出格式和结果,请编程实现(包裹...
若a=3,b=4,c=5,x=1.2.y=2.4,z=-3.6,u=51274,n=128765,c1=‘a’,c2=‘b’。若想得到以下输出格式和结果,请编程实现(包裹定义变量类型和设计输出格式)。
a=_3__b=_4__c=_5
x=1.200000,y=2.400000,z=-3.600000
x+y=_3.60__y+z=-1.20__z+x=-2.40
u=_51274__n=___128765
c1='a'_or_97(ASCII)
c2='b'_or_98(ASCII) 展开
a=_3__b=_4__c=_5
x=1.200000,y=2.400000,z=-3.600000
x+y=_3.60__y+z=-1.20__z+x=-2.40
u=_51274__n=___128765
c1='a'_or_97(ASCII)
c2='b'_or_98(ASCII) 展开
展开全部
//程序如下
#include<stdio.h>
void main()
{
int a=3,b=4,c=5;
long int u=51274,n=128765; //如果在VC++ 6.0中 定义成int型行
float x=1.2,y=2.4,z=-3.6;
char c1='a',c2='b';
printf("a=%d b=%d c=%d\n",a,b,c);
printf("x=%f y=%f z=%f\n",x,y,z);
printf("x+y=%1.2f y+z=%1.2f z+x=%1.2f\n",x+y,y+z,z+x);
printf("n=%ld u=%ld\n",u,n);
printf("c1=%c or %d\nc2=%c or %d\n",c1,c1,c2,c2);
}
#include<stdio.h>
void main()
{
int a=3,b=4,c=5;
long int u=51274,n=128765; //如果在VC++ 6.0中 定义成int型行
float x=1.2,y=2.4,z=-3.6;
char c1='a',c2='b';
printf("a=%d b=%d c=%d\n",a,b,c);
printf("x=%f y=%f z=%f\n",x,y,z);
printf("x+y=%1.2f y+z=%1.2f z+x=%1.2f\n",x+y,y+z,z+x);
printf("n=%ld u=%ld\n",u,n);
printf("c1=%c or %d\nc2=%c or %d\n",c1,c1,c2,c2);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询