猿问

for循环改造为while循环

怎样把一个for循环改造为while循环

QQ爱笑的女孩
浏览 2082回答 3
3回答

慕圣0830664

for (int i = 0; i < 10; i++) {     ...... } //转换成while()循环 int i = 0; while (i < 10) {     ......     i++; }

望远

for(循环变量初始化;循环条件判断;循环变量改变){     //...循环体 } 改成while: 循环变量初始化; while(循环条件判断){     //...循环体     循环变量改变; }

慕的地8582982

NJURSPZCMPKOSNQKANATQEBIIPWWPJAOESYAOLYYVOCJTAMQEUCJMTLUCPYVZFVEFJIPYGELFCGTXKQTAAISLGEBEBPDHEKNHLEZVQTDTNWAQUCXQULPFSVAEKILJPJSTDFSAXBRYYMPHHOYDQBOCPJSZMCJVJKHHORFCXJGDAXKYXEXMSDAWKXEXRCPZMFMCCFPTUBIMCJUYBKEBQWFZHXHDHKKHUXEBQNRGVYCJJJFIZKARVYZICCQUNGXFUQLPQEXRSMJEFFZELOLRSPOBXCSCWQUOMJDTVFMKVUIFWTUBLKDAJNEVHHZZBOBNRSFBEYLMTKXMQPDGFCMPSSWCGBMFUUROVNLTFKHFMWJSRETQMGDVLFLQYHDKKQHRBAOGZWCYHFCBEFZNKNXSDJEXLRQSHORVLIUBCQTPDXGGHDREOQKAUNPJCDDLYHXRFOEUBXQPYYMGGFOWWJCYYHPFKDNXZJCOSFFFREEQGKANBJXDWTKJGRHUUAZZGNYQKUAQJCMNLLHNGQQCMNGSCBRVWMPOBDXNZMWGEBDLPNQTJRSAGVFTQTPUUEXXAXAKXWNWGWGSZPKTXTOXKKTOMSIKIIIIPYPIXOPSIBERHXBTGPPPZZLBYYZLUUOXNNZRXOBHRQDIOAHFCJMCSCSDZWELRVYTSSZSISMVIVMWFFJTKONNKHBKKKMFOCBVYTWEDKRBRNRBVFVREPJIIHRIISLILWJNRMZPJOYIWYBMRNRSVZMOOYLVVLPYYBWMWGPJNKDQGQJJJHKLOHNTFWCPOYPZISGIYZSCCEQTAAGMQJZJSWWCGZSBYYVPIYLCMYRHTMHQDXXUILYSCCPVBOKATDTEAQTDUZPODNWXXDLYTBEQURVCLWR
随时随地看视频慕课网APP

相关分类

Java
我要回答