/* Name:1-100所有奇数求和的程序 Power by Stuart Date:2015-4-23 */ public class DateTest01{ public static void main(String args[]){ //for循环,每次循环间隔2次 for(int i=1;i<=100;i+=2){ t+=i;//t=i+1; } System.out.println("从1到100的奇数为"+t); } }…
#1到100求和sum1=0for x in range(101): sum1=sum1+xprint(sum1) #1到100偶数求和sum2=0for x in range(0,101,2): print(x) sum2=sum2+xprint("结果1:",sum2) #1到100奇数求和sum3=0for x in range(1,101,2): print(x) sum3=sum3+xprint("结果2:",sum3) #数列求最值a=[32,423,4…