C语言实现1-99奇偶数交替求和
int main(){ int i, sn=0, sign=1; for(i=1;i<100;i++){ sn=sn+sign*i; sign=-sign; } printf('%d',sn); }
原文地址: https://www.cveoy.top/t/topic/mY8d 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
int main(){ int i, sn=0, sign=1; for(i=1;i<100;i++){ sn=sn+sign*i; sign=-sign; } printf('%d',sn); }
原文地址: https://www.cveoy.top/t/topic/mY8d 著作权归作者所有。请勿转载和采集!