#include <stdio.h>
int main()
{
char a;
char b;
//输入a = a, b = b
printf("now input a: ");
scanf("%c",&a);
printf("now input b: ");
scanf("%c",&b);
printf("a = %c, b = %c\n",a,b);
return 0;
}
请问输出结果是什么?
同时怎么避免这个问题?
#include <stdio.h>
int main()
{
int a = 11;
printf("a = %f\n",a);
float b = 11;
printf("b = %d\n",b);
return 0;
}
请问输出结果是多少
#include <stdio.h>
int main()
{
char a = 0x80;
int b = 0x80;
printf("a = %d, b = %d\n",a,b);
return 0;
}
请问输出结果是什么?
#include <stdio.h>
int main()
{
int i = -20;
unsigned int j = 10;
printf("%d\n",i+j);
printf("%u\n",i+j);
return 0;
}
请问输出结果是什么
#include <stdio.h>
int main()
{
unsigned int i = -1;
printf("%d\n",i);
unsigned short j = -1;
printf("%d\n",j);
return 0;
}
请问输出结果是什么
#include<stdio.h>
int main()
{
char a = a;
printf("%d\n",a);
printf("%c\n",a);
return 0;
}
这段代码会报错还是警告?
换成char a = b呢?
是编译错误还是执行错误呢?