- 博客(3)
- 收藏
- 关注
原创 C语言字符数组问题
字符数组赋值问题 char a[20],b[]=“The sky is blue.”;int i; 输入 Fig flower is red.#include<stdio.h>int main(){ char a[20],b[]="The sky is blue."; int i; for(i=0;i<10;i++) scanf("%c",&...
2020-05-08 16:09:20
542
原创 C语言没给变量赋初值问题
有以下程序#include<stdio.h>int main(){ int i,sum; for(i=1;i<6;i++) sum+=i; printf("%d",sum); return 0;}本题重点考查for语句,变量没有初始化,默认值与编译器有关系,不同的编译器有不用的输出结果#include<stdio.h...
2020-05-07 15:42:09
3916
1
原创 C语言运算符中的左移与逻辑或问题
> #include<stdio.h>int main(){ int b=2; printf("%d",(b<<2)/(3||b)); return 0;}8<<为左移运算符,||为逻辑或运算符.先算b<<2,2左移两次 2*2*2=8 ,然后再算 3||b ,逻辑或(一真为真)为1 . (8)/(1)=8...
2020-05-06 15:49:18
218
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人