⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ep1_2.cpp

📁 这里有大量的c语言习题呢!真的是题海哦
💻 CPP
字号:
/*1.2 假定有下列变量:
int a=3,b=5,c=0;
float x=2.5,y=8.2,z=1.4;
char ch1='a',ch2='5',ch3='0',ch4;
求下列表达式的值,以及运算后表达式所涉及的各变量的值。
x+(int)y%a             x=z*b++,b=b*x,b++        ch4=ch3-ch2+ch1
int(y/z)+(int)y/(int)z      !(a>b)&&c&&(x*=y)&&b++
ch3||(b+=a*c)||c++       z=(a<<2)/(b>>1)
*/

#include<iostream.h>

void main()
{
	int a=3,b=5,c=0,result;
	bool result3;
	float result2,x=2.5,y=8.2,z=1.4;
	char ch1='a',ch2='5',ch3='0',ch4;

	result2=x+(int)y%a;
	cout<<result2<<endl;

	a=3,b=5,c=0;
	x=2.5,y=8.2,z=1.4;
	result=(x=z*b++,b=b*x,b++);
	cout<<result<<'\t'<<x<<'\t'<<b<<endl;

	a=3,b=5,c=0;
	x=2.5,y=8.2,z=1.4;
	ch1='a',ch2='5',ch3='0',ch4;
	ch4=ch3-ch2+ch1;
	cout<<ch4<<endl;

	a=3,b=5,c=0;
	x=2.5,y=8.2,z=1.4;
	result=int(y/z)+(int)y/(int)z;
	cout<<result<<endl;

	a=3,b=5,c=0;
	x=2.5,y=8.2,z=1.4;
	result3=!(a>b)&&c&&(x*=y)&&(b++);
	cout<<result3<<'\t'<<b<<endl;
	
    a=3,b=5,c=0;
    x=2.5,y=8.2,z=1.4;
    ch1='a',ch2='5',ch3='0';
	result3=ch3||(b+=a*c)||c++;
	cout<<result3<<'\t'<<c<<endl;
		
	a=3,b=5,c=0;
	x=2.5,y=8.2,z=1.4;
	z=(a<<2)/(b>>1);
	cout<<z<<endl;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -