摘要:
#do while语句 ###do while语句的语法 do 循环语句 while (表达式); #include<stdio.h> int main() { int i = 1; do { printf("%d", i); i++; } while (i <= 10); return 0; } 阅读全文
摘要:
#循环语句 while ###whlie语句结构 while(表达式) 循环语句; //在while循环中,break用于永久的终止循环 int main() { int i = 1;//初始化 while (i <= 10)//判断部分 { if (i == 5) break; printf("% 阅读全文
摘要:
#结构体 ##结构体可以让C语言创建新的类型 ###例如:创建一个学生 struct stu { char name[20];//成员变量 int age; double score; }; int main() { struct stu s = { "张三",20,85.5 };//结构体的创建和 阅读全文
摘要:
#操作符: ##算数操作符:+,-,*,/,% //注意: /#include<stdio.h> int main() { int a = 9 / 2;//得数为4,整型 float b = 9 / 2;//得数为4.000 float c = 9 / 2.0;//带小数位,得数为4.5 int d 阅读全文