新手求助循环

hycsp2414 2025-03-07 13:01:49 14

i++和++i有什么区别啊

{{ vote && vote.total.up }}

共 2 条回复

hycsp2414

哦哦这下知道区别了感谢!

novice 我信你个鬼

前者是先加后用,后者是先用后加; 例如1: i=4;cout<<i++<<endl; cout<<i<<endl; 输出为 4 5 例如2: i=4;cout<<++i<<endl; cout<<i<<endl; 输出为 5 5