这几天我们学习了条件语句,循环语句有if;switch,for ,while;
if条件语句的格式为:if (条件) {满足条件要执行的代码};
switcht条件语句的格式为: switch (key) {case value: break; default: break;}
for 循环的格式为for(循环条件){执行的代码}
while 格式为:while(条件){执行代码}
这几天我们学习了条件语句,循环语句有if;switch,for ,while;
if条件语句的格式为:if (条件) {满足条件要执行的代码};
switcht条件语句的格式为: switch (key) {case value: break; default: break;}
for 循环的格式为for(循环条件){执行的代码}
while 格式为:while(条件){执行代码}