#include
/*
int main()
{
short s = 0;
int a = 10;
printf("%dn",sizeof(s=a+5));//2 4个字节的整形放入2个字节的short中,应为2个字节
printf("%dn",s);//0
return 0;
}
*/
/*
int main()
{
int a = 0;
// a--> 00000000000000000000000000000000 ->原码
// ~a-->11111111111111111111111111111111 ->补码
// 11111111111111111111111111111110 ->反码
//printf打印原码 10000000000000000000000000000001 ->原码
printf("%dn",~a);//按二进制位取反
// - 1
return 0;
}
*/
/*
int main()
{
int a = 10;
//printf("%dn",++a);//前置++ -->先++后使用
printf("%dn",a++);//后置++ -->先使用后++
return 0;
}
*/
/*
int main()
{
int a = (int) 3.14;
printf("%dn",a);
return 0;
}
*/
/*
void test1(int arr[])
{
printf("%dn",sizeof(arr));
}
void test2(char ch[])
{
printf("%dn",sizeof(ch));
}
int main()
{
int arr[10] = { 0 };
char ch[10] = { 0 };
printf("%dn",sizeof(arr));//40
printf("%dn",sizeof(ch));//10
test1(arr);//数组传参传递的是首元素的地址 4/8字节
test2(ch);//
return 0;
}
*/
/*
int main()
{
int a = 3;//011
int b = 6;//110
int c = a && b;
int d = a || b;
printf("%dn",c);//两个同时为真才为真,结果为真
printf("%dn",d);//两个同时为假才为假,结果为真
return 0;
}
*/
/*
int main()
{ // i=0 a=0 b=010 c=011 d=100
int i = 0, a = 0, b = 2, c = 3, d = 4;
i = a++ && ++b && d++;
//a=a=0-->为假,不进行右边计算-->b=2 c=3 d=4
printf("a=%dn, b=%dn, c=%dn, d=%dn",a,b,c,d);
return 0;
}
*/
/*
int main()
{ // i=0 a=0 b=010 c=011 d=100
int i = 0, a = 1, b = 2, c = 3, d = 4;
//i = a++ && ++b && d++; //&&遇到假则停止 2334
i = a++ || ++b || d++; //||运算遇到真则停止 2234
printf("a=%dn, b=%dn, c=%dn, d=%dn", a, b, c, d);
return 0;
}
*/
/*
int main()
{
//int a = 0;
//int b = 0;
//if (a > 5)
// b = 3;
//else
// b = -3;
//printf("%dn",b);
int a = 0;
int b = 0;
b = (a > 5 ? 3 : -3);
printf("%dn",b);
int a = 10;
int b = 20;
int max = 0;
max = (a > b ? a : b);
printf("%dn", max);
return 0;
}
*/
/*
int main()
{
int a = 1;
int b = 2;
int c = (a > b, a = b + 10, a , b = a + 1);//ca
printf("%d %d %d n", a, b, c);
return 0;
}
*/
/*
int main()
{
int a[10] = { 0 };
a[4] = 10;
printf("%d %dn",a[4],a[5]);
return 0;
}
*/
/*
struct student
{
char name[20];
int age;
char id[20];
};
int main()
{
int a = 10;
//使用struct student这个类型创建了一个学生对象s1,并初始化
struct student s1 = { "张三" , 20 , "20230311" };
struct student *ps = &s1;
printf("%sn",(*ps).name);
printf("%dn",(*ps).age);
printf("%sn",(*ps).id);
printf("%sn",ps->name);
printf("%dn",ps->age);
printf("%sn",ps->id );
printf("%sn",s1.name);
printf("%dn",s1.age);
printf("%sn",s1.id);
return 0;
}
*/
/*
int main()
{ //二进制数加减用补码运算
char a = 3;//正常来说是00000000000000000000000000000011
//char中只能存放8个字节故为00000011 -a
char b = 127;//00000000000000000000000001111111
//01111111 -b
//a+b
// 00000000000000000000000000000011
// 00000000000000000000000001111111
//结果 00000000000000000000000010000010
char c = a + b;//c->10000010
//将c按符号位补全,符号位为1
//11111111111111111111111110000010 --补码
//11111111111111111111111110000001 --反码
//10000000000000000000000001111110 --原码
//-126
printf("%dn",c);
return 0;
}
*/
/*
int main()
{
char a = 0xb6;//101101110
short b = 0xb600;
int c = 0xb6000000;
if (a == 0xb6)
printf("a");
if (b == 0xb600)
printf("b");
if (c == 0xb6000000)
printf("c");
return 0;
}
*/
/*
int main()
{//整形提升,c参与表达式运算,由1个字节变为4个字节
char c = 1;
printf("%un",sizeof(c));//1
printf("%un", sizeof(+c));//4
printf("%un", sizeof(!c));//1
return 0;
}
*/
/*
int main()
{
int a = 10;
int b = 20;
int c = b + a * 3;
printf("%dn",c );
return 0;
}
*/
/*
int main()
{ //无意义,++i无顺序导致结果不确定
int i = 1;
int c = (++i) + (++i) + (++i);
printf("%dn",c);
return 0;
}
*/
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.e1idc.net