C语言中有三种类型的循环:for,while,do-while. while循环先判断循环条件. while (condition) { //gets executed after condition is checked } do-while循环先执行循环体重的语句,再判断循环条件. do { //gets executed at least once } while (condition); for循环可以一行中初始化一个计数变量,设置一个判断条件,和计数变量的自增. ; x < ; x++…